Skip to content

Commit

Permalink
Discontinue building the separate tool containers
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Nov 30, 2023
1 parent e82cdbf commit 49f2b6d
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 217 deletions.
57 changes: 2 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,44 +50,6 @@ jobs:
tags: "${{ env.IMAGE_NAME }}:${{ github.run_id }}"
cache-from: type=gha,scope=${{ matrix.channel }}
cache-to: type=gha,scope=${{ matrix.channel }},mode=max
build_tool_containers:
name: Build ${{ matrix.tool }} tool container
runs-on: ubuntu-latest
needs: build_compiler_containers
strategy:
matrix:
tool:
- clippy
- miri
- rustfmt
if: 'github.event_name == ''push'' || contains(github.event.pull_request.labels.*.name, ''CI: approved'')'
env:
IMAGE_NAME: ghcr.io/integer32llc/rust-playground-ci-tool-${{ matrix.tool }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ github.event.pull_request.head.sha }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=moby/buildkit:v0.11.6
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ env.GH_CONTAINER_REGISTRY_USERNAME }}"
password: "${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }}"
- name: Build and push container
uses: docker/build-push-action@v4
with:
context: compiler/${{ matrix.tool }}/
file: compiler/${{ matrix.tool }}/Dockerfile
build-args: base_image=ghcr.io/integer32llc/rust-playground-ci-rust-nightly:${{ github.run_id }}
push: true
tags: "${{ env.IMAGE_NAME }}:${{ github.run_id }}"
cache-from: type=gha,scope=${{ matrix.tool }}
cache-to: type=gha,scope=${{ matrix.tool }},mode=max
build_backend:
name: Build backend
runs-on: ubuntu-latest
Expand Down Expand Up @@ -171,7 +133,6 @@ jobs:
if: 'github.event_name == ''push'' || contains(github.event.pull_request.labels.*.name, ''CI: approved'')'
needs:
- build_compiler_containers
- build_tool_containers
- build_backend
- build_frontend
defaults:
Expand All @@ -198,19 +159,14 @@ jobs:
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Pull containers
run: echo ghcr.io/integer32llc/rust-playground-ci-{rust-{stable,beta,nightly},tool-{clippy,rustfmt,miri}}:${{ github.run_id }} | xargs -n1 docker pull
run: echo ghcr.io/integer32llc/rust-playground-ci-rust-{stable,beta,nightly}:${{ github.run_id }} | xargs -n1 docker pull
- name: Rename containers
run: |-
for c in stable beta nightly; do
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-rust-$c
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} shepmaster/rust-$c
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} rust-$c
done
for t in clippy miri rustfmt; do
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-tool-$t
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} shepmaster/$t
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} $t
done
- name: Download backend
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -265,29 +221,20 @@ jobs:
username: "${{ env.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
- name: Pull containers
run: echo ghcr.io/integer32llc/rust-playground-ci-{rust-{stable,beta,nightly},tool-{clippy,rustfmt,miri}}:${{ github.run_id }} | xargs -n1 docker pull
run: echo ghcr.io/integer32llc/rust-playground-ci-rust-{stable,beta,nightly}:${{ github.run_id }} | xargs -n1 docker pull
- name: Rename containers
run: |-
for c in stable beta nightly; do
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-rust-$c
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} shepmaster/rust-$c
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} rust-$c
done
for t in clippy miri rustfmt; do
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-tool-$t
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} shepmaster/$t
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} $t
done
- name: Push containers
run: |-
for c in stable beta nightly; do
docker push ghcr.io/integer32llc/rust-playground-ci-rust-$c
docker push shepmaster/rust-$c
done
for t in clippy miri rustfmt; do
docker push ghcr.io/integer32llc/rust-playground-ci-tool-$t
docker push shepmaster/$t
done
- name: Download backend
uses: actions/download-artifact@v3
with:
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,55 +61,3 @@ jobs:
run: |-
docker push ${{ env.IMAGE_NAME }}
docker push ${{ env.DOCKER_HUB_IMAGE_NAME }}
build_tool_containers:
name: Build ${{ matrix.tool }} tool container
runs-on: ubuntu-latest
needs: build_compiler_containers
strategy:
matrix:
tool:
- clippy
- miri
- rustfmt
env:
IMAGE_NAME: ghcr.io/integer32llc/rust-playground-ci-tool-${{ matrix.tool }}
DOCKER_HUB_IMAGE_NAME: shepmaster/${{ matrix.tool }}
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=moby/buildkit:v0.11.6
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ env.GH_CONTAINER_REGISTRY_USERNAME }}"
password: "${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }}"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: "${{ env.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
- name: Build and push container
uses: docker/build-push-action@v4
with:
context: compiler/${{ matrix.tool }}/
file: compiler/${{ matrix.tool }}/Dockerfile
build-args: base_image=ghcr.io/integer32llc/rust-playground-ci-rust-nightly:${{ github.run_id }}
push: true
tags: "${{ env.IMAGE_NAME }}:${{ github.run_id }}"
cache-from: type=gha,scope=${{ matrix.tool }}
cache-to: type=gha,scope=${{ matrix.tool }},mode=max
- name: Pull container
run: docker pull ${{ env.IMAGE_NAME }}:${{ github.run_id }}
- name: Rename container
run: |-
docker tag ${{ env.IMAGE_NAME }}:${{ github.run_id }} ${{ env.IMAGE_NAME }}
docker tag ${{ env.IMAGE_NAME }}:${{ github.run_id }} ${{ env.DOCKER_HUB_IMAGE_NAME }}
- name: Push container
run: |-
docker push ${{ env.IMAGE_NAME }}
docker push ${{ env.DOCKER_HUB_IMAGE_NAME }}
68 changes: 1 addition & 67 deletions ci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,36 +64,10 @@ components:
cache-from: type=gha,scope=${{ matrix.channel }}
cache-to: type=gha,scope=${{ matrix.channel }},mode=max

- build_tool_containers_job: &build_tool_containers_job
name: "Build ${{ matrix.tool }} tool container"
runs-on: ubuntu-latest
needs: build_compiler_containers

strategy:
matrix:
tool: [clippy, miri, rustfmt]

- build_tool_containers_job_env: &build_tool_containers_job_env
IMAGE_NAME: ghcr.io/integer32llc/rust-playground-ci-tool-${{ matrix.tool }}

- build_tool_containers: &build_tool_containers
name: "Build and push container"
uses: docker/build-push-action@v4
with:
context: compiler/${{ matrix.tool }}/
file: compiler/${{ matrix.tool }}/Dockerfile
build-args: |-
base_image=ghcr.io/integer32llc/rust-playground-ci-rust-nightly:${{ github.run_id }}
push: true
tags: |-
${{ env.IMAGE_NAME }}:${{ github.run_id }}
cache-from: type=gha,scope=${{ matrix.tool }}
cache-to: type=gha,scope=${{ matrix.tool }},mode=max

- pull_containers: &pull_containers
name: "Pull containers"
run: |-
echo ghcr.io/integer32llc/rust-playground-ci-{rust-{stable,beta,nightly},tool-{clippy,rustfmt,miri}}:${{ github.run_id }} | xargs -n1 docker pull
echo ghcr.io/integer32llc/rust-playground-ci-rust-{stable,beta,nightly}:${{ github.run_id }} | xargs -n1 docker pull
- rename_all_containers: &rename_all_containers
name: "Rename containers"
Expand All @@ -103,11 +77,6 @@ components:
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} shepmaster/rust-$c
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} rust-$c
done
for t in clippy miri rustfmt; do
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-tool-$t
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} shepmaster/$t
docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} $t
done
- pull_current_container: &pull_current_container
name: "Pull container"
Expand Down Expand Up @@ -152,18 +121,6 @@ workflows:
- *login_ghcr
- *build_compiler_containers

build_tool_containers:
<<: *build_tool_containers_job
if: "github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'CI: approved')"
env:
<<: *build_tool_containers_job_env

steps:
- *checkout_pr
- *docker_buildx
- *login_ghcr
- *build_tool_containers

build_backend:
name: "Build backend"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -266,7 +223,6 @@ workflows:
if: "github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'CI: approved')"
needs:
- build_compiler_containers
- build_tool_containers
- build_backend
- build_frontend

Expand Down Expand Up @@ -367,10 +323,6 @@ workflows:
docker push ghcr.io/integer32llc/rust-playground-ci-rust-$c
docker push shepmaster/rust-$c
done
for t in clippy miri rustfmt; do
docker push ghcr.io/integer32llc/rust-playground-ci-tool-$t
docker push shepmaster/$t
done
- name: "Download backend"
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -444,21 +396,3 @@ workflows:
- *pull_current_container
- *rename_current_container
- *push_current_container

build_tool_containers:
<<: *build_tool_containers_job
env:
<<: *build_tool_containers_job_env
DOCKER_HUB_IMAGE_NAME: shepmaster/${{ matrix.tool }}
continue-on-error: true

steps:
- *checkout
- *docker_buildx
- *login_ghcr
- *login_docker_hub
- *build_tool_containers

- *pull_current_container
- *rename_current_container
- *push_current_container
17 changes: 0 additions & 17 deletions compiler/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
set -euv -o pipefail

channels_to_build="${CHANNELS_TO_BUILD-stable beta nightly}"
tools_to_build="${TOOLS_TO_BUILD-rustfmt clippy miri}"

repository=shepmaster

Expand All @@ -21,19 +20,3 @@ for channel in $channels_to_build; do

cd ..
done

crate_api_base=https://crates.io/api/v1/crates

for tool in $tools_to_build; do
cd "${tool}"

image_name="${tool}"
full_name="${repository}/${image_name}"

docker build -t "${full_name}" \
.

docker tag "${full_name}" "${image_name}"

cd ..
done
6 changes: 0 additions & 6 deletions compiler/clippy/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion compiler/fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euv -o pipefail

repository=shepmaster

for image in rust-stable rust-beta rust-nightly rustfmt clippy miri; do
for image in rust-stable rust-beta rust-nightly; do
docker pull "${repository}/${image}"
# The backend expects images without a repository prefix
docker tag "${repository}/${image}" "${image}"
Expand Down
6 changes: 0 additions & 6 deletions compiler/miri/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions compiler/miri/cargo-miri-playground

This file was deleted.

6 changes: 0 additions & 6 deletions compiler/rustfmt/Dockerfile

This file was deleted.

0 comments on commit 49f2b6d

Please sign in to comment.