Skip to content

Commit 7a169f4

Browse files
Adrinlolagneum
authored andcommitted
chore(ui): add tag 3.5.0 (after the release) to SE installer", rename the image tag "Generic Postgres" for version 16, add the tag '0.4.2' for the "Generic Postgres" image
1 parent d502d77 commit 7a169f4

File tree

4 files changed

+3478
-4038
lines changed

4 files changed

+3478
-4038
lines changed

Diff for: ui/.gitlab-ci.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include:
1010
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
1111

1212
.ui_cache: &ui_cache
13-
image: node:lts-alpine
13+
image: node:21.1.0-alpine
1414
cache: &cache
1515
key: "$CI_COMMIT_REF_SLUG"
1616
paths:
@@ -23,8 +23,9 @@ check-code-style:
2323
<<: *ui_cache
2424
stage: test
2525
before_script:
26-
- apk add --no-cache curl
27-
- curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
26+
- corepack enable
27+
- corepack prepare [email protected] --activate
28+
- export PNPM_HOME=/usr/local/bin
2829
- pnpm config set store-dir /builds/postgres-ai/database-lab/.pnpm-store/
2930

3031
script:
@@ -59,15 +60,17 @@ semgrep-sast:
5960

6061
e2e-ce-ui-test:
6162
<<: *ui_checks
62-
<<: *ui_cache
63-
image: node:latest
63+
image: node:21.1.0
6464
stage: integration-test
65+
variables:
66+
CYPRESS_CACHE_FOLDER: '$CI_PROJECT_DIR/cache/Cypress'
6567
before_script:
6668
- apt update && apt install curl
6769
- apt install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
6870
- npm install -g wait-on
6971
- npm install -g pnpm
70-
- pnpm config set store-dir /builds/postgres-ai/database-lab/.pnpm-store/
72+
# TODO: Set up caching.
73+
# - pnpm config set store-dir /builds/postgres-ai/database-lab/.pnpm-store/
7174
script:
7275
- pnpm --dir ui/ i --no-frozen-lockfile
7376
- pnpm --dir ui/ --filter @postgres.ai/ce start & wait-on http://localhost:3001

Diff for: ui/packages/platform/src/components/DbLabInstanceForm/utils/index.tsx

+13-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { initialState } from '../reducer'
55
const API_SERVER = process.env.REACT_APP_API_SERVER
66
export const DEBUG_API_SERVER = 'https://v2.postgres.ai/api/general'
77

8-
export const availableTags = ['3.4.0', '4.0.0-alpha.6']
8+
export const availableTags = ['3.5.0', '3.4.0', '4.0.0-alpha.6']
99

10-
export const sePackageTag = 'v1.0-rc.9'
10+
export const sePackageTag = 'v1.0-rc.10'
1111

1212
export const dockerRunCommand = (provider: string) => {
1313
/* eslint-disable no-template-curly-in-string */
@@ -50,9 +50,17 @@ export const getPlaybookCommand = (
5050
volume_size='${state.storage}' \\\r
5151
dblab_engine_verification_token='${state.verificationToken}' \\\r
5252
dblab_engine_version='${state.tag}' \\\r
53-
${ state.snapshots > 1 ? `zpool_datasets_number='${state.snapshots}' \\\r` : `` }
54-
${ orgKey ? `platform_org_key='${orgKey}' \\\r` : `` }
55-
${ API_SERVER === DEBUG_API_SERVER ? `platform_url='${DEBUG_API_SERVER}' \\\r` : `` }
53+
${
54+
state.snapshots > 1
55+
? `zpool_datasets_number='${state.snapshots}' \\\r`
56+
: ``
57+
}
58+
${orgKey ? `platform_org_key='${orgKey}' \\\r` : ``}
59+
${
60+
API_SERVER === DEBUG_API_SERVER
61+
? `platform_url='${DEBUG_API_SERVER}' \\\r`
62+
: ``
63+
}
5664
${state.publicKeys ? `ssh_public_keys='${state.publicKeys}' \\\r` : ``}
5765
platform_project_name='${state.name}'"`
5866

Diff for: ui/packages/shared/pages/Configuration/utils/index.ts

+45-99
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,29 @@ import { FormValues } from '../useForm'
55

66
const seContainerRegistry = 'se-images'
77
const genericImagePrefix = 'postgresai/extended-postgres'
8+
// since some tags are rc, we need to specify the exact tags to use
9+
const dockerImagesConfig = {
10+
'9.6': ['0.4.2', '0.4.1', '0.3.0'],
11+
'10': ['0.4.2', '0.4.1', '0.3.0'],
12+
'11': ['0.4.2', '0.4.1', '0.3.0'],
13+
'12': ['0.4.2', '0.4.1', '0.3.0'],
14+
'13': ['0.4.2', '0.4.1', '0.3.0'],
15+
'14': ['0.4.2', '0.4.1', '0.3.0'],
16+
'15': ['0.4.2', '0.4.1', '0.3.0'],
17+
'16': ['0.4.2', '0.4.1'],
18+
}
819

920
export type FormValuesKey = keyof FormValues
1021

22+
interface DockerImage {
23+
package_group: string
24+
pg_major_version: string
25+
tag: string
26+
location: string
27+
}
28+
29+
type DockerImagesConfig = Record<string, string[]>
30+
1131
export const uniqueChipValue = (values: string) => {
1232
const splitChipArray = values.split(/[,(\s)(\n)(\r)(\t)(\r\n)]/)
1333
let databaseArray = []
@@ -39,106 +59,32 @@ export const postUniqueDatabases = (values: string) => {
3959
return values.length !== 0 ? nonEmptyDatabase : null
4060
}
4161

62+
const createDockerImages = (
63+
dockerImagesConfig: DockerImagesConfig,
64+
): DockerImage[] => {
65+
const dockerImages: DockerImage[] = []
66+
67+
for (const pg_major_version in dockerImagesConfig) {
68+
if (dockerImagesConfig.hasOwnProperty(pg_major_version)) {
69+
const customTags = dockerImagesConfig[pg_major_version]
70+
71+
customTags.forEach((tag) => {
72+
const image: DockerImage = {
73+
package_group: 'postgresai',
74+
pg_major_version,
75+
tag: `${pg_major_version}-${tag}`,
76+
location: `${genericImagePrefix}:${pg_major_version}-${tag}`,
77+
}
78+
79+
dockerImages.push(image)
80+
})
81+
}
82+
}
83+
84+
return dockerImages
85+
}
4286

43-
// using the same json data structue as se-images
44-
export const genericDockerImages = [
45-
{
46-
package_group: 'postgresai',
47-
pg_major_version: '9.6',
48-
tag: '9.6-0.4.1',
49-
location: `${genericImagePrefix}:9.6-0.4.1`,
50-
},
51-
{
52-
package_group: 'postgresai',
53-
pg_major_version: '9.6',
54-
tag: '9.6-0.3.0',
55-
location: `${genericImagePrefix}:9.6-0.3.0`,
56-
},
57-
{
58-
package_group: 'postgresai',
59-
pg_major_version: '10',
60-
tag: '10-0.4.1',
61-
location: `${genericImagePrefix}:10-0.4.1`,
62-
},
63-
{
64-
package_group: 'postgresai',
65-
pg_major_version: '10',
66-
tag: '10-0.3.0',
67-
location: `${genericImagePrefix}:10-0.3.0`,
68-
},
69-
{
70-
package_group: 'postgresai',
71-
pg_major_version: '11',
72-
tag: '11-0.4.1',
73-
location: `${genericImagePrefix}:11-0.4.1`,
74-
},
75-
{
76-
package_group: 'postgresai',
77-
pg_major_version: '11',
78-
tag: '11-0.3.0',
79-
location: `${genericImagePrefix}:11-0.3.0`,
80-
},
81-
{
82-
package_group: 'postgresai',
83-
pg_major_version: '12',
84-
tag: '12-0.4.1',
85-
location: `${genericImagePrefix}:12-0.4.1`,
86-
},
87-
{
88-
package_group: 'postgresai',
89-
pg_major_version: '12',
90-
tag: '12-0.3.0',
91-
location: `${genericImagePrefix}:12-0.3.0`,
92-
},
93-
{
94-
package_group: 'postgresai',
95-
pg_major_version: '13',
96-
tag: '13-0.4.1',
97-
location: `${genericImagePrefix}:13-0.4.1`,
98-
},
99-
{
100-
package_group: 'postgresai',
101-
pg_major_version: '13',
102-
tag: '13-0.3.0',
103-
location: `${genericImagePrefix}:13-0.3.0`,
104-
},
105-
{
106-
package_group: 'postgresai',
107-
pg_major_version: '14',
108-
tag: '14-0.4.1',
109-
location: `${genericImagePrefix}:14-0.4.1`,
110-
},
111-
{
112-
package_group: 'postgresai',
113-
pg_major_version: '14',
114-
tag: '14-0.3.0',
115-
location: `${genericImagePrefix}:14-0.3.0`,
116-
},
117-
{
118-
package_group: 'postgresai',
119-
pg_major_version: '15',
120-
tag: '15-0.4.1',
121-
location: `${genericImagePrefix}:15-0.4.1`,
122-
},
123-
{
124-
package_group: 'postgresai',
125-
pg_major_version: '15',
126-
tag: '15-0.3.0',
127-
location: `${genericImagePrefix}:15-0.3.0`,
128-
},
129-
{
130-
package_group: 'postgresai',
131-
pg_major_version: '16',
132-
tag: '16rc1-0.4.1',
133-
location: `${genericImagePrefix}:16rc1-0.4.1`,
134-
},
135-
{
136-
package_group: 'postgresai',
137-
pg_major_version: '16',
138-
tag: '16-0.3.0',
139-
location: `${genericImagePrefix}:16-0.3.0`,
140-
},
141-
]
87+
export const genericDockerImages = createDockerImages(dockerImagesConfig)
14288

14389
export const isSeDockerImage = (dockerImage: string | undefined) => {
14490
const dockerImageType =

0 commit comments

Comments
 (0)