Skip to content

Commit

Permalink
Merge pull request #1005 from rust-lang/crate-report
Browse files Browse the repository at this point in the history
Migrate crate reporting to the orchestrator
  • Loading branch information
shepmaster authored Nov 30, 2023
2 parents c5eadf7 + 49f2b6d commit 7035da1
Show file tree
Hide file tree
Showing 18 changed files with 121 additions and 548 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
24 changes: 24 additions & 0 deletions compiler/base/orchestrator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions compiler/base/orchestrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ bincode = { version = "1.3", default-features = false }
futures = { version = "0.3.28", default-features = false, features = ["executor"] }
modify-cargo-toml = { path = "../modify-cargo-toml", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.108", default-features = false, features = ["std"] }
snafu = { version = "0.7.4", default-features = false, features = ["futures", "std"] }
tokio = { version = "1.28", default-features = false, features = ["fs", "io-std", "io-util", "macros", "process", "rt", "time", "sync"] }
tokio-stream = { version = "0.1.14", default-features = false }
Expand Down
Loading

0 comments on commit 7035da1

Please sign in to comment.