-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(ci): implement image caching to reduce ci build time. #8735
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
Merged
spacewander
merged 48 commits into
apache:master
from
shreemaan-abhishek:reduce-ci-build-time
Feb 16, 2023
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
0f5d5fa
feat(ci): implement image caching
shreemaan-abhishek 4b74e0d
fix: rename buckup to backup
shreemaan-abhishek 8766547
reformat code
shreemaan-abhishek e7df672
encapsulate
shreemaan-abhishek fae9911
fix incorrect variable name
shreemaan-abhishek 374e39f
replace negated -z with -n
shreemaan-abhishek bd6b858
add new line
shreemaan-abhishek 8c563bf
replace lanuch with launch
shreemaan-abhishek 6337e12
merge launch common svcs and launch svcs steps
shreemaan-abhishek 03b532d
fix shellcheck error
shreemaan-abhishek f0cda12
encapsulate to separate bash scripts
shreemaan-abhishek 3f1274d
add echo commands
shreemaan-abhishek a5a021a
add new line
shreemaan-abhishek 8b49bea
encapsulate
shreemaan-abhishek 63bc306
update files to be hashed
shreemaan-abhishek 94e66c7
use format function for hashFile path
shreemaan-abhishek 18c12be
fix lint errors
shreemaan-abhishek c402763
add logs
shreemaan-abhishek 39d0240
add more logs
shreemaan-abhishek 15cb0ef
add make command
shreemaan-abhishek 754a67f
fix store password
shreemaan-abhishek d95c880
add check
shreemaan-abhishek ebe06c3
Revert "add check"
shreemaan-abhishek 6593836
build function image only when cache miss
shreemaan-abhishek 0db11d1
add "after" as positional parameter
shreemaan-abhishek 912790f
don\'t cache common images
shreemaan-abhishek 940fd54
delete redundant scripts
shreemaan-abhishek 1ff4bbf
combine 3 steps to one
shreemaan-abhishek d9489f3
combine 3 steps to one
shreemaan-abhishek 850a725
fix indentation
shreemaan-abhishek 9c72fe6
add echo command
shreemaan-abhishek 3ca5329
add echo command
shreemaan-abhishek 2360006
combine 3 steps to one
shreemaan-abhishek 6c45b80
replace if-else with case
shreemaan-abhishek 54af0b4
remove logs
shreemaan-abhishek 165c046
fix non-zero exit code error
shreemaan-abhishek 3dbd35f
isolate saving docker images to a separate step
shreemaan-abhishek 05ce727
remove whitespace
shreemaan-abhishek 34b7037
add conditional
shreemaan-abhishek 6dcb77c
delete backup archive after loading images
shreemaan-abhishek d2c4821
delete some files to preserve space
shreemaan-abhishek 550f2fa
update key name
shreemaan-abhishek ed01f7f
Trigger Build
shreemaan-abhishek 78a3794
add script to free disk space
shreemaan-abhishek ea08ca4
trigger build
shreemaan-abhishek 2c3eaa3
add appropriate indentations
shreemaan-abhishek 9e7d282
use four space indentation
shreemaan-abhishek e4d38d3
add comment
shreemaan-abhishek 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| test_type=$1 | ||
|
|
||
| echo "started backing up, time: $(date)" | ||
| mkdir docker-images-backup | ||
| sum=$(cat ci/pod/docker-compose.$test_type.yml | grep image | wc -l) | ||
| special_tag=$(cat ci/pod/docker-compose.$test_type.yml | grep image: | awk '{print $2}' | awk 'ORS=NR%"'$sum'"?" ":"\n"{print}') | ||
| echo special: $special_tag | ||
| openwhisk_tag="openwhisk/action-nodejs-v14:nightly openwhisk/standalone:nightly" | ||
| echo | ||
| echo special_tag: $special_tag | ||
| echo openwhisk_tag: $openwhisk_tag | ||
| echo | ||
| all_tags="${special_tag} ${openwhisk_tag}" | ||
| to_pull="" | ||
|
|
||
| for tag in $all_tags | ||
| do | ||
| if ! ( docker inspect $tag &> /dev/null ) | ||
| then | ||
| to_pull="${to_pull} ${tag}" | ||
| fi | ||
| done | ||
|
|
||
| echo to pull : $to_pull | ||
|
|
||
| if [[ -n $to_pull ]] | ||
| then | ||
| echo "$to_pull" | xargs -P10 -n1 docker pull | ||
| fi | ||
|
|
||
| docker save $special_tag $openwhisk_tag -o docker-images-backup/apisix-images.tar | ||
| echo "docker save done, time: $(date)" |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| # GitHub Action CI runner comes with a limited disk space, due to several reasons | ||
| # it may become full. For example, caching docker images creates an archive of | ||
| # several GBs of size, this sometimes leads to disk usage becoming full. | ||
| # To keep CI functional, we delete large directories that we do not need. | ||
|
|
||
| echo "==============================================================================" | ||
| echo "Freeing up disk space on CI system" | ||
| echo "==============================================================================" | ||
|
|
||
| df -h | ||
| echo "Removing unnecessary large directories" | ||
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /usr/share/swift | ||
| df -h | ||
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.