Skip to content
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

Use GitHub Container as Extension Installation. #17

Merged
merged 1 commit into from
Jul 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Build & Run Development Container
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/customink/crypteia
imageName: ghcr.io/customink/crypteia-devcontainer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not part of the PR here but I wanted to have each package (two container images soon) associated with this repo have intention revealing names.

runCmd: |
./bin/setup
./amzn/setup
Expand All @@ -46,3 +46,9 @@ jobs:
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Push Lambda Extension Layer Image
env:
CRYPTEIA_VERSION: ${{ steps.changelog_reader.outputs.version }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG, I'm so in love with this Action that parses the CHANGELOG.

run: |
echo "${{ secrets.PUBLIC_GITHUB_TOKEN_PACKAGES }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
./layer/deploy-image
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the new PUBLIC_GITHUB_TOKEN_PACKAGES secret (cc @shellerci) for our open source repos. This will push the Amazon Linux 2 container image along with the other release binary and shared object files. Hmm... typing this out, I think I should add -amzn suffix here too and make a debian one.

4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
AWS_SESSION_TOKEN
AWS_DEFAULT_REGION
AWS_REGION
imageName: ghcr.io/customink/crypteia
imageName: ghcr.io/customink/crypteia-devcontainer
runCmd: |
./bin/setup
./bin/test
Expand All @@ -40,7 +40,7 @@ jobs:
AWS_SESSION_TOKEN
AWS_DEFAULT_REGION
AWS_REGION
imageName: ghcr.io/customink/crypteia
imageName: ghcr.io/customink/crypteia-devcontainer
runCmd: |
./amzn/setup
./amzn/test
8 changes: 8 additions & 0 deletions layer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM alpine
LABEL org.opencontainers.image.source "https://github.com/customink/crypteia"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty neat... GitHub should use this label to associate the package with this repo.

LABEL org.opencontainers.image.description "Rust Lambda Extension for any Runtime to preload SSM Parameters as Secure Environment Variables!"

RUN mkdir -p /opt/lib
RUN mkdir -p /opt/extensions
COPY ./build/crypteia-amzn /opt/extensions/crypteia
COPY ./build/libcrypteia-amzn.so /opt/lib/libcrypteia.so
15 changes: 15 additions & 0 deletions layer/deploy-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -e

if [ -z "${CRYPTEIA_VERSION}" ]; then
echo "CRYPTEIA_VERSION is not set"
exit 1
fi

TAG="ghcr.io/customink/crypteia-extension:${CRYPTEIA_VERSION}"

echo "== [Lambda Extension Image] building... =="
docker build --tag $TAG --file layer/Dockerfile .

echo "== [Lambda Extension Image] push... =="
docker push $TAG