-
Notifications
You must be signed in to change notification settings - Fork 11
feat: implement install and uninstall flow #68
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
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1e681a1
add shim downloader script
voigt 3a3effc
add node-installer and shim-downloader to install job
voigt a08b228
fix docker build context
voigt 0f5653a
fix sbom
voigt 9fbb55c
add downloader to depandabot
voigt edf549e
fix deploy runtimeclass
voigt 83f2ef8
fix debug settings
voigt 37270d1
improve uninstall semantics
voigt e4275ab
let uninstall throw proper errors
voigt 543ff7f
fix
voigt fc1500b
quick fix
voigt 93f9e60
update download_shim.sh
voigt 9241762
add opconfig for job manifest creation
voigt 7ce7569
update spin shim test resource
voigt ff5edbd
bring test back
voigt cd16a63
let uninstall exit with 0
voigt 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build shim-downloader image, sign it, and generate SBOMs | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
digest: | ||
description: "Container image digest" | ||
value: ${{jobs.build.outputs.digest}} | ||
|
||
push: | ||
branches: | ||
- "main" | ||
- "feat-**" | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/container-image.yml | ||
permissions: | ||
contents: read | ||
packages: write | ||
with: | ||
image-name: shim-downloader | ||
dockerfile: ./images/downloader/Dockerfile | ||
docker-context: ./images/downloader | ||
push-image: true | ||
|
||
sign: | ||
needs: build | ||
uses: ./.github/workflows/sign-image.yml | ||
permissions: | ||
packages: write | ||
id-token: write | ||
with: | ||
image-repository: ${{ needs.build.outputs.repository }} | ||
image-digest: ${{ needs.build.outputs.digest }} | ||
|
||
sbom: | ||
needs: build | ||
uses: ./.github/workflows/sbom.yml | ||
permissions: | ||
packages: write | ||
id-token: write | ||
with: | ||
image-name: shim-downloader | ||
image-digest: ${{ needs.build.outputs.digest }} |
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
voigt marked this conversation as resolved.
Show resolved
Hide resolved
|
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,5 @@ | ||
FROM alpine:3.19.1 | ||
|
||
RUN apk add --no-cache curl bash tar | ||
COPY download_shim.sh /download_shim.sh | ||
CMD bash /download_shim.sh |
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 | ||
set -euo pipefail | ||
|
||
declare -A levels=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3) | ||
script_logging_level="INFO" | ||
|
||
log() { | ||
local log_message=$1 | ||
local log_priority=$2 | ||
|
||
#check if level exists | ||
[[ ${levels[$log_priority]} ]] || return 1 | ||
|
||
#check if level is enough | ||
(( ${levels[$log_priority]} < ${levels[$script_logging_level]} )) && return 2 | ||
|
||
#log here | ||
d=$(date '+%Y-%m-%dT%H:%M:%S') | ||
echo -e "${d}\t${log_priority}\t${log_message}" | ||
} | ||
|
||
log "start downloading shim from ${SHIM_LOCATION}..." "INFO" | ||
|
||
mkdir -p /assets | ||
|
||
# overwrite default name of shim binary; use the name of shim resource instead | ||
# to enable installing multiple versions of the same shim | ||
curl -sL "${SHIM_LOCATION}" | tar --transform "s/containerd-shim-.*/containerd-shim-${SHIM_NAME}/" -xzf - -C /assets | ||
log "download successful:" "INFO" | ||
|
||
ls -lah /assets |
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
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.