-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce images size #1636
Merged
+967
−419
Merged
Reduce images size #1636
Changes from 28 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
5c4bab5
Use nodemon instead of PM2
a3daaeb
Reduce production image size
dfff4d9
Nit
c184da6
Update scripts
104092b
Fix plugin-dev
6ca77b1
Save 4mo
93bc34e
Move images
c76aafa
asynchronous extract
cd5a6b1
Fix images
ee0bb17
Nit
e423165
nit
437bdca
Reduce size
c429fb4
wip
b04ce12
Plugin-dev ok
9e0d229
merge ok
f87ed79
Add wait-elasticsearch
9b98ace
kuzzleio/kuzzle ok
6862c52
kuzzleio/alpine ok
ff1ae5e
all images ok
bb3818f
Add README
19f3314
Fix tests
383f8b5
trigger ci
271413d
fix test
0df3a7b
fix sh
119bb7d
use node for startup scripts
70e5fa8
Bump node 12.18.1
41d1cf5
Merge branch 'master' into reduce-production-image-size
Aschen 17660d7
Fix dependencies install in tests
e331000
Update docker/scripts/run-dev.sh
Aschen f14f4c4
Update scripts
b33d5b9
Merge branch 'master' into reduce-production-image-size
Aschen bd5a9c2
Update scripts
8b219d4
Merge branch 'reduce-production-image-size' of github.com:kuzzleio/ku…
3764998
replace everest by scratch
5904564
Merge branch 'reduce-production-image-size' of github.com:kuzzleio/ku…
2525a86
fix scratch image
1ea882f
factorize steps
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
elastic_host=${kuzzle_services__storageEngine__client__node:-http://elasticsearch:9200} | ||
set -x | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
NODE_VERSION=$NODE_12_VERSION | ||
|
||
|
@@ -12,33 +11,10 @@ export NVM_DIR="$HOME/.nvm" | |
. "$NVM_DIR/nvm.sh" | ||
nvm use $NODE_VERSION | ||
|
||
|
||
echo "[$(date --rfc-3339 seconds)] - Waiting for elasticsearch to be available" | ||
while ! curl -f -s -o /dev/null "$elastic_host" | ||
do | ||
echo "[$(date --rfc-3339 seconds)] - Still trying to connect to $elastic_host" | ||
sleep 1 | ||
done | ||
# create a tmp index just to force the shards to init | ||
echo "[$(date --rfc-3339 seconds)] - Elasticsearch is up. Waiting for shards to be active (can take a while)" | ||
E=$(curl -s "$elastic_host/_cluster/health?wait_for_status=yellow&timeout=60s") | ||
|
||
if ! (echo ${E} | grep -E '"status":"(yellow|green)"' > /dev/null); then | ||
echo "============ Cluster health response" | ||
echo $E | ||
echo "============ Cluster allocation explanation" | ||
curl -s http://$elastic_host/_cluster/allocation/explain?pretty | ||
echo "[$(date --rfc-3339 seconds)] - Could not connect to elasticsearch in time. Aborting..." | ||
exit 1 | ||
fi | ||
|
||
node bin/start-kuzzle-server --enable-plugins functional-test-plugin & | ||
|
||
echo "[$(date --rfc-3339 seconds)] - Starting Kuzzle..." | ||
while ! curl -f -s -o /dev/null http://localhost:7512 | ||
do | ||
echo "[$(date --rfc-3339 seconds)] - Still trying to connect to Kuzzle" | ||
sleep 1 | ||
done | ||
echo "[$(date)] - Starting Kuzzle..." | ||
|
||
./bin/wait-kuzzle | ||
|
||
npm run test:functional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,21 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
elastic_host=${kuzzle_services__storageEngine__client__node:-http://elasticsearch:9200} | ||
set -x | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
|
||
NODE_VERSION=$NODE_12_VERSION | ||
|
||
echo "Testing Kuzzle against node v$NODE_VERSION" | ||
n $NODE_VERSION | ||
|
||
npm install --silent --unsafe-perm | ||
npm install --silent --unsafe-perm --only=dev | ||
chmod -R 777 node_modules/ | ||
docker-compose/scripts/install-plugins.sh | ||
|
||
echo "[$(date --rfc-3339 seconds)] - Waiting for elasticsearch to be available" | ||
spinner="/" | ||
while ! curl -f -s -o /dev/null "$elastic_host" | ||
do | ||
printf '\r' | ||
echo -n "[$(date --rfc-3339 seconds)] - Still trying to connect to $elastic_host [$spinner]" | ||
if [ "$spinner" = "/" ]; then spinner="\\"; else spinner="/" ; fi | ||
sleep 1 | ||
done | ||
# create a tmp index just to force the shards to init | ||
echo "[$(date --rfc-3339 seconds)] - Elasticsearch is up. Waiting for shards to be active (can take a while)" | ||
E=$(curl -s "$elastic_host/_cluster/health?wait_for_status=yellow&timeout=60s") | ||
|
||
if ! (echo ${E} | grep -E '"status":"(yellow|green)"' > /dev/null); then | ||
echo "============ Cluster health response" | ||
echo $E | ||
echo "============ Cluster allocation explanation" | ||
curl -s http://$elastic_host/_cluster/allocation/explain?pretty | ||
echo "[$(date --rfc-3339 seconds)] - Could not connect to elasticsearch in time. Aborting..." | ||
exit 1 | ||
fi | ||
|
||
node bin/start-kuzzle-server --enable-plugins functional-test-plugin & | ||
./docker/scripts/install-plugins.sh | ||
|
||
echo "[$(date --rfc-3339 seconds)] - Starting Kuzzle..." | ||
timeout=$((20 * 60)) | ||
while ! curl -f -s -o /dev/null http://localhost:7512 | ||
do | ||
printf '\r' | ||
echo -n "[$(date --rfc-3339 seconds)] - Still trying to connect to Kuzzle [$spinner]" | ||
if [ "$spinner" = "/" ]; then spinner="\\"; else spinner="/" ; fi | ||
echo "[$(date)] - Starting Kuzzle..." | ||
|
||
timeout=$((timeout - 1)) | ||
if [ $timeout -eq 0 ]; then | ||
echo "[$(date --rfc-3339 seconds)] - Timeout" | ||
fi | ||
node bin/start-kuzzle-server --enable-plugins functional-test-plugin & | ||
|
||
sleep 1 | ||
done | ||
./bin/wait-kuzzle | ||
|
||
npm run test:functional | ||
npm run $KUZZLE_FUNCTIONAL_TESTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.