generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Language plugins choose the runner image (#3268)
Language plugins can now declare the runner image to use by including a ModuleRuntime in the Module schema. Image names do not include the tag to use, instead FTL will use the same tag that the rest of FTL is using. If a language plugin does not choose a runner image, it is defaulted to`ftl0/ftl-runner`. --------- Co-authored-by: Alec Thomas <[email protected]>
- Loading branch information
1 parent
26f349a
commit ab91f25
Showing
23 changed files
with
559 additions
and
465 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -236,15 +236,18 @@ jobs: | |
- uses: cashapp/[email protected] | ||
- uses: ./.github/actions/build-cache | ||
- run: just build-docker provisioner | ||
docker-build-runner: | ||
name: Build Runner Docker Image | ||
docker-build-runners: | ||
name: Build Runner Docker Images | ||
# if: github.event_name != 'pull_request' || github.event.action == 'enqueued' || contains( github.event.pull_request.labels.*.name, 'run-all') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cashapp/[email protected] | ||
- uses: ./.github/actions/build-cache | ||
- run: just build-docker runner | ||
- name: Build Runner Docker Image | ||
run: just build-docker runner | ||
- name: Build JVM Docker Image | ||
run: just build-docker runner-jvm | ||
docker-build-box: | ||
name: Build Box Docker Image | ||
# if: github.event_name != 'pull_request' || github.event.action == 'enqueued' || contains( github.event.pull_request.labels.*.name, 'run-all') | ||
|
This file contains 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 |
---|---|---|
|
@@ -4,15 +4,15 @@ on: | |
- "v[0-9]+.[0-9]+.[0-9]+" | ||
name: Automatically Build Release | ||
jobs: | ||
build-runner: | ||
name: Build Runner Docker Image | ||
build-runners: | ||
name: Build Runner Docker Images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Init Hermit | ||
uses: cashapp/[email protected] | ||
- name: Build | ||
- name: Build Runner | ||
run: | | ||
just build-docker runner | ||
mkdir -p artifacts/ftl-runner | ||
|
@@ -23,6 +23,17 @@ jobs: | |
name: docker-runner-artifact | ||
path: artifacts/ftl-runner/ftl-runner.tar | ||
retention-days: 1 | ||
- name: Build JVM Runner | ||
run: | | ||
just build-docker runner-jvm | ||
mkdir -p artifacts/ftl-runner-jvm | ||
docker save -o artifacts/ftl-runner-jvm/ftl-runner-jvm.tar ftl0/ftl-runner-jvm:latest | ||
- name: Temporarily save JVM Docker image | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docker-runner-jvm-artifact | ||
path: artifacts/ftl-runner-jvm/ftl-runner-jvm.tar | ||
retention-days: 1 | ||
build-controller: | ||
name: Build Controller Docker Image | ||
runs-on: ubuntu-latest | ||
|
@@ -86,7 +97,7 @@ jobs: | |
permissions: | ||
contents: read | ||
packages: write | ||
needs: [build-runner, build-controller, build-provisioner, build-box] | ||
needs: [build-runners, build-controller, build-provisioner, build-box] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
@@ -99,6 +110,11 @@ jobs: | |
with: | ||
name: docker-runner-artifact | ||
path: artifacts/ftl-runner | ||
- name: Retrieve JVM Runner Docker image | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: docker-runner-jvm-artifact | ||
path: artifacts/ftl-runner-jvm | ||
- name: Retrieve Controller Docker image | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -116,6 +132,8 @@ jobs: | |
path: artifacts/ftl-box | ||
- name: Load Runner Docker image | ||
run: docker load -i artifacts/ftl-runner/ftl-runner.tar | ||
- name: Load JVM Runner Docker image | ||
run: docker load -i artifacts/ftl-runner-jvm/ftl-runner-jvm.tar | ||
- name: Load Controller Docker image | ||
run: docker load -i artifacts/ftl-controller/ftl-controller.tar | ||
- name: Load Provisioner Docker image | ||
|
@@ -133,6 +151,9 @@ jobs: | |
docker tag ftl0/ftl-runner:latest ftl0/ftl-runner:"$GITHUB_SHA" | ||
docker tag ftl0/ftl-runner:latest ftl0/ftl-runner:"$version" | ||
docker push -a ftl0/ftl-runner | ||
docker tag ftl0/ftl-runner-jvm:latest ftl0/ftl-runner-jvm:"$GITHUB_SHA" | ||
docker tag ftl0/ftl-runner-jvm:latest ftl0/ftl-runner-jvm:"$version" | ||
docker push -a ftl0/ftl-runner-jvm | ||
docker tag ftl0/ftl-controller:latest ftl0/ftl-controller:"$GITHUB_SHA" | ||
docker tag ftl0/ftl-controller:latest ftl0/ftl-controller:"$version" | ||
docker push -a ftl0/ftl-controller | ||
|
This file contains 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 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,19 @@ | ||
FROM ubuntu:24.04 AS builder | ||
RUN apt-get update | ||
RUN apt-get install -y curl git zip | ||
|
||
# Seed some of the most common tools - this will be cached | ||
COPY ./bin /src/bin | ||
ENV PATH="/src/bin:$PATH" | ||
ENV HERMIT_STATE_DIR=/hermit | ||
RUN hermit install openjdk-17.0.8_7 | ||
RUN mvn -B --version | ||
|
||
# Finally create the runtime image. | ||
FROM ftl0/ftl-runner:latest | ||
|
||
WORKDIR /root/ | ||
|
||
ENV PATH="/root/jdk/bin:$PATH" | ||
ENV JAVA_HOME="/root/jdk" | ||
COPY --from=builder /hermit/pkg/openjdk-17.0.8_7/ /root/jdk/ |
This file contains 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 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.