nsarrazin commited on
Commit
be655e8
·
unverified ·
1 Parent(s): c6ccfa4

feat(ci): add a health check after building the docker image (#1837)

Browse files

* feat(ci): add a health check after building the docker image

* fix: change group for running health check

* fix: newline in command

* fix: docker container image name

* fix: its goign to work a lot better if you run the container first

* temp: try to break ci

* temp: try to break ci pt 2

* temp: revert broken ci, healthcheck works yay!

.github/workflows/lint-and-test.yml CHANGED
@@ -44,9 +44,41 @@ jobs:
44
  npm run test
45
 
46
  build-check:
47
- runs-on: ubuntu-latest
 
48
  timeout-minutes: 10
49
  steps:
50
  - uses: actions/checkout@v3
51
  - name: Build Docker image
52
- run: docker build --secret id=DOTENV_LOCAL,src=.env.ci --build-arg SKIP_LLAMA_CPP_BUILD=true -t chat-ui:latest .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  npm run test
45
 
46
  build-check:
47
+ runs-on:
48
+ group: aws-general-8-plus
49
  timeout-minutes: 10
50
  steps:
51
  - uses: actions/checkout@v3
52
  - name: Build Docker image
53
+ run: |
54
+ docker build \
55
+ --build-arg INCLUDE_DB=true \
56
+ --build-arg SKIP_LLAMA_CPP_BUILD=true \
57
+ -t chat-ui-test:latest .
58
+
59
+ - name: Run Docker container
60
+ run: |
61
+ export DOTENV_LOCAL=$(<.env.ci)
62
+ docker run -d --rm --network=host \
63
+ --name chat-ui-test \
64
+ -e DOTENV_LOCAL="$DOTENV_LOCAL" \
65
+ chat-ui-test:latest
66
+
67
+ - name: Wait for server to start
68
+ run: |
69
+ for i in {1..10}; do
70
+ if curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/ | grep -q "200"; then
71
+ echo "Server is up"
72
+ exit 0
73
+ fi
74
+ echo "Waiting for server..."
75
+ sleep 2
76
+ done
77
+ echo "Server did not start in time"
78
+ docker logs chat-ui-test
79
+ exit 1
80
+
81
+ - name: Stop Docker container
82
+ if: always()
83
+ run: |
84
+ docker stop chat-ui-test || true
package-lock.json CHANGED
@@ -64,7 +64,7 @@
64
  "@iconify-json/carbon": "^1.1.16",
65
  "@iconify-json/eos-icons": "^1.1.6",
66
  "@sveltejs/adapter-node": "^5.2.12",
67
- "@sveltejs/kit": "^2.20.7",
68
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
69
  "@tailwindcss/typography": "^0.5.9",
70
  "@types/dompurify": "^3.0.5",
@@ -98,16 +98,16 @@
98
  "prettier-plugin-tailwindcss": "^0.6.11",
99
  "prom-client": "^15.1.2",
100
  "sade": "^1.8.1",
101
- "svelte": "^5.27.2",
102
  "svelte-check": "^4.0.0",
103
  "svelte-gestures": "^5.1.3",
104
  "ts-node": "^10.9.1",
105
  "tslib": "^2.4.1",
106
  "typescript": "^5.5.0",
107
  "unplugin-icons": "^0.16.1",
108
- "vite": "^6.3.4",
109
  "vite-node": "^3.0.9",
110
- "vitest": "^3.0.9"
111
  },
112
  "optionalDependencies": {
113
  "@anthropic-ai/sdk": "^0.32.1",
@@ -5175,17 +5175,18 @@
5175
  }
5176
  },
5177
  "node_modules/@sveltejs/kit": {
5178
- "version": "2.20.7",
5179
- "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.20.7.tgz",
5180
- "integrity": "sha512-dVbLMubpJJSLI4OYB+yWYNHGAhgc2bVevWuBjDj8jFUXIJOAnLwYP3vsmtcgoxNGUXoq0rHS5f7MFCsryb6nzg==",
5181
  "dev": true,
5182
  "license": "MIT",
5183
  "dependencies": {
 
5184
  "@types/cookie": "^0.6.0",
 
5185
  "cookie": "^0.6.0",
5186
  "devalue": "^5.1.0",
5187
  "esm-env": "^1.2.2",
5188
- "import-meta-resolve": "^4.1.0",
5189
  "kleur": "^4.1.5",
5190
  "magic-string": "^0.30.5",
5191
  "mrmime": "^2.0.0",
@@ -6087,9 +6088,10 @@
6087
  }
6088
  },
6089
  "node_modules/acorn": {
6090
- "version": "8.12.1",
6091
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
6092
- "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
 
6093
  "bin": {
6094
  "acorn": "bin/acorn"
6095
  },
@@ -9496,16 +9498,6 @@
9496
  "url": "https://github.com/sponsors/sindresorhus"
9497
  }
9498
  },
9499
- "node_modules/import-meta-resolve": {
9500
- "version": "4.1.0",
9501
- "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz",
9502
- "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==",
9503
- "dev": true,
9504
- "funding": {
9505
- "type": "github",
9506
- "url": "https://github.com/sponsors/wooorm"
9507
- }
9508
- },
9509
  "node_modules/imurmurhash": {
9510
  "version": "0.1.4",
9511
  "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
@@ -14519,9 +14511,9 @@
14519
  }
14520
  },
14521
  "node_modules/svelte": {
14522
- "version": "5.27.2",
14523
- "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.27.2.tgz",
14524
- "integrity": "sha512-WQigWAJSONxMfIYFBnnKXf5s+TcXbktLsZ+HMLfjhjSHOW9C0OV9TmPPTxVdbxs5tuiS8iQecCxLTHpdgWwgiA==",
14525
  "license": "MIT",
14526
  "dependencies": {
14527
  "@ampproject/remapping": "^2.3.0",
@@ -15479,9 +15471,9 @@
15479
  }
15480
  },
15481
  "node_modules/vite": {
15482
- "version": "6.3.4",
15483
- "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.4.tgz",
15484
- "integrity": "sha512-BiReIiMS2fyFqbqNT/Qqt4CVITDU9M9vE+DKcVAsB+ZV0wvTKd+3hMbkpxz1b+NmEDMegpVbisKiAZOnvO92Sw==",
15485
  "license": "MIT",
15486
  "dependencies": {
15487
  "esbuild": "^0.25.0",
 
64
  "@iconify-json/carbon": "^1.1.16",
65
  "@iconify-json/eos-icons": "^1.1.6",
66
  "@sveltejs/adapter-node": "^5.2.12",
67
+ "@sveltejs/kit": "^2.21.1",
68
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
69
  "@tailwindcss/typography": "^0.5.9",
70
  "@types/dompurify": "^3.0.5",
 
98
  "prettier-plugin-tailwindcss": "^0.6.11",
99
  "prom-client": "^15.1.2",
100
  "sade": "^1.8.1",
101
+ "svelte": "^5.33.3",
102
  "svelte-check": "^4.0.0",
103
  "svelte-gestures": "^5.1.3",
104
  "ts-node": "^10.9.1",
105
  "tslib": "^2.4.1",
106
  "typescript": "^5.5.0",
107
  "unplugin-icons": "^0.16.1",
108
+ "vite": "^6.3.5",
109
  "vite-node": "^3.0.9",
110
+ "vitest": "^3.1.4"
111
  },
112
  "optionalDependencies": {
113
  "@anthropic-ai/sdk": "^0.32.1",
 
5175
  }
5176
  },
5177
  "node_modules/@sveltejs/kit": {
5178
+ "version": "2.21.1",
5179
+ "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.21.1.tgz",
5180
+ "integrity": "sha512-vLbtVwtDcK8LhJKnFkFYwM0uCdFmzioQnif0bjEYH1I24Arz22JPr/hLUiXGVYAwhu8INKx5qrdvr4tHgPwX6w==",
5181
  "dev": true,
5182
  "license": "MIT",
5183
  "dependencies": {
5184
+ "@sveltejs/acorn-typescript": "^1.0.5",
5185
  "@types/cookie": "^0.6.0",
5186
+ "acorn": "^8.14.1",
5187
  "cookie": "^0.6.0",
5188
  "devalue": "^5.1.0",
5189
  "esm-env": "^1.2.2",
 
5190
  "kleur": "^4.1.5",
5191
  "magic-string": "^0.30.5",
5192
  "mrmime": "^2.0.0",
 
6088
  }
6089
  },
6090
  "node_modules/acorn": {
6091
+ "version": "8.14.1",
6092
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz",
6093
+ "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==",
6094
+ "license": "MIT",
6095
  "bin": {
6096
  "acorn": "bin/acorn"
6097
  },
 
9498
  "url": "https://github.com/sponsors/sindresorhus"
9499
  }
9500
  },
 
 
 
 
 
 
 
 
 
 
9501
  "node_modules/imurmurhash": {
9502
  "version": "0.1.4",
9503
  "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
 
14511
  }
14512
  },
14513
  "node_modules/svelte": {
14514
+ "version": "5.33.3",
14515
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.33.3.tgz",
14516
+ "integrity": "sha512-NOw+amc+BLyAx1DbMKPY76lvuS2TKJxX5n+1c4Qva+fpAGuCXe+GJmTM5MoTtgoXT1uzZBsLgp0GVvW5RY+k+A==",
14517
  "license": "MIT",
14518
  "dependencies": {
14519
  "@ampproject/remapping": "^2.3.0",
 
15471
  }
15472
  },
15473
  "node_modules/vite": {
15474
+ "version": "6.3.5",
15475
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
15476
+ "integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
15477
  "license": "MIT",
15478
  "dependencies": {
15479
  "esbuild": "^0.25.0",
package.json CHANGED
@@ -22,7 +22,7 @@
22
  "@iconify-json/carbon": "^1.1.16",
23
  "@iconify-json/eos-icons": "^1.1.6",
24
  "@sveltejs/adapter-node": "^5.2.12",
25
- "@sveltejs/kit": "^2.20.7",
26
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
27
  "@tailwindcss/typography": "^0.5.9",
28
  "@types/dompurify": "^3.0.5",
@@ -56,16 +56,16 @@
56
  "prettier-plugin-tailwindcss": "^0.6.11",
57
  "prom-client": "^15.1.2",
58
  "sade": "^1.8.1",
59
- "svelte": "^5.27.2",
60
  "svelte-check": "^4.0.0",
61
  "svelte-gestures": "^5.1.3",
62
  "ts-node": "^10.9.1",
63
  "tslib": "^2.4.1",
64
  "typescript": "^5.5.0",
65
  "unplugin-icons": "^0.16.1",
66
- "vite": "^6.3.4",
67
  "vite-node": "^3.0.9",
68
- "vitest": "^3.0.9"
69
  },
70
  "type": "module",
71
  "dependencies": {
 
22
  "@iconify-json/carbon": "^1.1.16",
23
  "@iconify-json/eos-icons": "^1.1.6",
24
  "@sveltejs/adapter-node": "^5.2.12",
25
+ "@sveltejs/kit": "^2.21.1",
26
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
27
  "@tailwindcss/typography": "^0.5.9",
28
  "@types/dompurify": "^3.0.5",
 
56
  "prettier-plugin-tailwindcss": "^0.6.11",
57
  "prom-client": "^15.1.2",
58
  "sade": "^1.8.1",
59
+ "svelte": "^5.33.3",
60
  "svelte-check": "^4.0.0",
61
  "svelte-gestures": "^5.1.3",
62
  "ts-node": "^10.9.1",
63
  "tslib": "^2.4.1",
64
  "typescript": "^5.5.0",
65
  "unplugin-icons": "^0.16.1",
66
+ "vite": "^6.3.5",
67
  "vite-node": "^3.0.9",
68
+ "vitest": "^3.1.4"
69
  },
70
  "type": "module",
71
  "dependencies": {