Skip to content

Commit

Permalink
build rqlite with apko
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed Dec 8, 2023
1 parent 8452ca5 commit 19bacc7
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .github/actions/build-push-rqlite-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Build and push rqlite image'
description: 'Composite action for building and pushing rqlite image'
inputs:
image-name:
description: 'Full destination rqlite image name'
required: true

registry-username:
description: 'Username to login to registry'
default: ''
required: false

registry-password:
description: 'Password to login to registry'
default: ''
required: false

runs:
using: "composite"
steps:
- uses: chainguard-images/actions/apko-publish@main
with:
config: deploy/rqlite/apko.yaml
archs: x86_64
tag: ${{ inputs.image-name }}
vcs-url: true
generic-user: ${{ inputs.registry-username }}
generic-pass: ${{ inputs.registry-password }}
11 changes: 11 additions & 0 deletions .github/workflows/alpha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ jobs:
mapfile -t envs < <(grep -v '#.*' < .image.env) && export "${envs[@]}" && make -C migrations schema-alpha
build-rqlite:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-push-rqlite-image
with:
image-name: index.docker.io/kotsadm/rqlite:alpha
registry-username: ${{ secrets.DOCKERHUB_USER }}
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}


build-kotsadm:
runs-on: ubuntu-20.04
needs: [generate-tag]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,11 @@ jobs:
with:
path: .image.env

- name: push rqlite for CI
run: |
docker pull rqlite/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
docker tag rqlite/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }} ttl.sh/automated-${{ github.run_id }}/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
docker push ttl.sh/automated-${{ github.run_id }}/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
- uses: ./.github/actions/build-push-rqlite-image
with:
image-name: ttl.sh/automated-${{ github.run_id }}/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
registry-username: ${{ secrets.DOCKERHUB_USER }}
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}


push-dex:
Expand Down
29 changes: 29 additions & 0 deletions deploy/rqlite/apko.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
contents:
repositories:
- https://packages.wolfi.dev/os
keyring:
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
packages:
- rqlite # TODO NOW: pin to a version
- bash
- busybox
- wolfi-baselayout

accounts:
groups:
- groupname: rqlite
gid: 1001
users:
- username: rqlite
uid: 1001
gid: 1001
run-as: rqlite

entrypoint:
command: docker-entrypoint.sh

cmd: /rqlite

archs:
- x86_64
- aarch64
4 changes: 4 additions & 0 deletions pkg/kotsadm/objects/rqlite_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func RqliteStatefulset(deployOptions types.DeployOptions, size resource.Quantity
Name: "rqlite",
ContainerPort: 4001,
},
{
Name: "raft",
ContainerPort: 4002,
},
},
VolumeMounts: volumeMounts,
Env: getRqliteEnvs(),
Expand Down

0 comments on commit 19bacc7

Please sign in to comment.