Skip to content

Commit

Permalink
Add SFRUNNER_VER env var
Browse files Browse the repository at this point in the history
  • Loading branch information
kobl1nhs committed Mar 19, 2024
1 parent 2338605 commit 097d1fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Build docker image (arm64)
run: task build PLATFORM_SUFFIX=arm64 PLATFORM=linux/arm64/v8 AWS_ACC=${{ secrets.AWS_ACC }}
run: task build PLATFORM_SUFFIX=arm64 PLATFORM=linux/arm64/v8 AWS_ACC=${{ secrets.AWS_ACC }} SFRUNNER_VER=${{ github.run_number }}
- name: Build docker image (amd64)
run: task build PLATFORM_SUFFIX=amd64 PLATFORM=linux/amd64 AWS_ACC=${{ secrets.AWS_ACC }}
run: task build PLATFORM_SUFFIX=amd64 PLATFORM=linux/amd64 AWS_ACC=${{ secrets.AWS_ACC }} SFRUNNER_VER=${{ github.run_number }}
- name: Log into AWS
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,15 @@ However, you can install sfrunner directly, clone the repository and run the fol
`sfrunner` directory

```bash
task build PLATFORM=linux/arm64/v8 PLATFORM_SUMMARY=arm64 AWS_ACC=[AWSACCOUNTID]
task build PLATFORM=linux/arm64/v8 PLATFORM_SUMMARY=arm64 AWS_ACC=[AWSACCOUNTID] SFRUNNER_VER=[SFRUNNER_VER]
task install
echo 'export WITH_DOCKER=true #automatically run sfrunner with docker support' >> ~/.zshrc
```
Take care to substitute the AWS account ID for the mgmt account in place of `[AWSACCOUNTID]`.

Subsitute a version number in the place of `[SFRUNNER_VER]` - this will be accessible inside
the container in the environment variable `SFRUNNER_VER`.

The example above is assuming Apple Silicon, but substitute different values for `PLATFORM` and `PLATFORM_SUMMARY` as
appropriate.

Expand Down
2 changes: 2 additions & 0 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ ENV AWS_REGION_ABBREVIATION_TYPE=fixed
ARG AWS_ACC
ENV DOCKER_IMAGE="${AWS_ACC}.dkr.ecr.eu-west-2.amazonaws.com/uec-sf/sfrunner"
ENV DOCKER_TAG="latest"
ARG SFRUNNER_VER
ENV SFRUNNER_VER="${SFRUNNER_VER}"

ENV JAVA_HOME=/usr/lib/jvm/temurin-20-jdk-arm64

Expand Down
5 changes: 3 additions & 2 deletions taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ tasks:
PLATFORM: '{{.PLATFORM}}'
PLATFORM_SUFFIX: '{{.PLATFORM_SUFFIX}}'
AWS_ACC: '{{.AWS_ACC}}'
SFRUNNER_VER: '{{.SFRUNNER_VER}}'
requires:
vars: [PLATFORM, PLATFORM_SUFFIX, AWS_ACC]
vars: [PLATFORM, PLATFORM_SUFFIX, AWS_ACC, SFRUNNER_VER]
dir: src
cmds:
- docker build -t sfrunner:latest-{{.PLATFORM_SUFFIX}} --platform {{.PLATFORM}} --build-arg AWS_ACC={{.AWS_ACC}} .
- docker build -t sfrunner:latest-{{.PLATFORM_SUFFIX}} --platform {{.PLATFORM}} --build-arg AWS_ACC={{.AWS_ACC}} --build-arg SFRUNNER_VER={{.SFRUNNER_VER}} .

run:
desc: Runs a shell inside the sfrunner image
Expand Down

0 comments on commit 097d1fc

Please sign in to comment.