Skip to content

Commit

Permalink
ci: test buiding arm base (#38)
Browse files Browse the repository at this point in the history
* ci: test buiding arm base

Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch authored May 20, 2024
1 parent d9aebe2 commit 26566b0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,46 @@ on:
# rainbow:latest doesn't have flux (for the scheduler)
# both have the rainbow / rainbow-scheduler build, it's just one has flux ;)
jobs:
# Only build arm image on merge, takes too long otherwise
build-arm:
if: (github.event_name != 'pull_request')
permissions:
packages: write
env:
container: ghcr.io/converged-computing/rainbow-scheduler:arm
runs-on: ubuntu-latest
name: build rainbow (scheduler) arm
steps:
- uses: actions/checkout@v4

- name: Add custom buildx ARM builder
run: |
docker buildx create --name armbuilder
docker buildx use armbuilder
docker buildx inspect --bootstrap
- name: Build Containers
run: make docker-arm

- name: Tag Release Image
if: (github.event_name == 'release')
run: |
tag=${GITHUB_REF#refs/tags/}
echo "Tagging and releasing ${{ env.container}}:arm-${tag}"
docker tag ${{ env.container }}:latest ${{ env.container }}:arm-${tag}
- name: GHCR Login
if: (github.event_name != 'pull_request')
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy Container
if: (github.event_name != 'pull_request')
run: docker push ${{ env.container }} --all-tags

build-rainbow:
permissions:
packages: write
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ ARG base="ubuntu:jammy"
FROM $base
USER root
LABEL MAINTAINER Author <vsoch>
ARG arch=amd64
ENV arch=$arch

# install go 20.10
RUN apt-get update && apt-get install -y wget python3-pip
RUN wget https://go.dev/dl/go1.20.10.linux-amd64.tar.gz && tar -xvf go1.20.10.linux-amd64.tar.gz && \
mv go /usr/local && rm go1.20.10.linux-amd64.tar.gz
RUN wget https://go.dev/dl/go1.20.10.linux-${arch}.tar.gz && tar -xvf go1.20.10.linux-${arch}.tar.gz && \
mv go /usr/local && rm go1.20.10.linux-${arch}.tar.gz

ENV PATH=/usr/local/go/bin:$PATH
WORKDIR /code
COPY . /code
RUN make build && \
cp ./bin/rainbow /usr/bin && \
cp ./bin/rainbow-scheduler /usr/local/bin
cp ./bin/rainbow-scheduler /usr/local/bin/

# ensure we install the python bindings
RUN cd /code/python/v1 && \
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ docker-flux:
docker-ubuntu:
docker build -t $(REGISTRY)/rainbow-scheduler:latest .

.PHONY: docker-arm
docker-arm:
docker buildx build --build-arg arch=arm64 --platform linux/arm64 --tag $(REGISTRY)/rainbow-scheduler:arm .

.PHONY: proto
proto: protoc ## Generates the API code and documentation
mkdir -p pkg/api/v1
Expand Down

0 comments on commit 26566b0

Please sign in to comment.