Skip to content

Commit

Permalink
Merge branch 'checkup-no-latest' into 'master'
Browse files Browse the repository at this point in the history
Do not use "latest" for postgres-checkup + a couple of tweaks of checkup form

See merge request postgres-ai/database-lab!860
  • Loading branch information
NikolayS committed Apr 26, 2024
2 parents be17a32 + 3207c9a commit f43ffd2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,9 @@ class CheckupAgentForm extends Component<
id="hostName"
className={classes.textInput}
helperText={
'Hostname(s) or IP address(es) divided ' +
'by `;`, `,`, space or end of string'
'Enter hostnames or IPs, separated by commas, spaces, or line breaks. ' +
'To reach your machine\'s "localhost" from the container, use "host.docker.internal". ' +
'The same approach works when using SSH port forwarding from your machine to a remote host.'
}
margin="normal"
onChange={(e) => {
Expand Down Expand Up @@ -552,6 +553,11 @@ class CheckupAgentForm extends Component<
variant="outlined"
id="databaseUserName"
className={classes.textInput}
helperText={
'You can create a new DB user named "pgai_observer", then grant ' +
'the "pg_monitor" role to this user using the following SQL command: ' +
'GRANT pg_monitor TO pgai_observer;'
}
margin="normal"
onChange={(e) => {
this.setState({
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/platform/src/components/Reports/Reports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ class Reports extends Component<ReportsWithStylesProps, ReportsState> {
onClick={() => this.props.history.push('/' + org + '/checkup-config')}
title={
this.props.orgPermissions?.checkupReportConfigure
? 'Add Checkup agent to your server'
? 'Start generating new reports for your Postgres servers'
: messages.noPermission
}
>
Add agent
Generate report
</ConsoleButtonWrapper>
)

Expand Down
13 changes: 10 additions & 3 deletions ui/packages/platform/src/utils/cfggen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ cat <<EOF > ${data.projectName}.yml
${this.generateCheckupConfig(data)}
EOF
# Start check health of Postgres databases
`

if (data.password === 'inputpassword') {
Expand All @@ -140,11 +139,19 @@ EOF
&& read -s -p "" DB_PWD \\
&& PGPASSWORD="$\{DB_PWD}" \\
&& `
} else {
result =
result +
`# Specify Postgres password
export DB_PWD=****
`
}

result =
result +
`docker run \\
`# Start check health of Postgres databases
docker run \\
-v $(pwd)/${data.projectName}.yml:/${data.projectName}.yml \\
-v $(pwd)/artifacts:/artifacts \\`

Expand All @@ -162,7 +169,7 @@ EOF
-e ${hostsType}="${hosts}" \\
-e CHECKUP_SNAPSHOT_DISTANCE_SECONDS=${data.collectPeriod} \\
-e PGPASSWORD="$\{DB_PWD}" \\
registry.gitlab.com/postgres-ai/postgres-checkup:latest bash run_checkup.sh
registry.gitlab.com/postgres-ai/postgres-checkup:1-5-1 bash run_checkup.sh
`

return result
Expand Down

0 comments on commit f43ffd2

Please sign in to comment.