feat: add web3 blockchain and AI/ML infrastructure devcontainers (#12) #4
This file contains hidden or 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
| name: Build and Publish Docker Images | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'base/**' | |
| - 'intermediate/**' | |
| - 'infra/**' | |
| - '.github/workflows/docker-publish.yml' | |
| workflow_dispatch: | |
| inputs: | |
| layer: | |
| description: 'Layer to build (all builds everything)' | |
| default: 'all' | |
| type: choice | |
| options: | |
| - all | |
| - base | |
| - intermediate | |
| - infra | |
| image: | |
| description: 'Specific image name (optional, leave empty for all in layer)' | |
| required: false | |
| type: string | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_PREFIX: ghcr.io/${{ github.repository_owner }}/devcontainers | |
| jobs: | |
| # ============================================ | |
| # BASE LAYER | |
| # ============================================ | |
| build-base: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'base' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push base-system | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: base/base-system.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/base-system:latest | |
| ${{ env.IMAGE_PREFIX }}/base-system:${{ github.sha }} | |
| cache-from: type=gha,scope=base-system | |
| cache-to: type=gha,mode=max,scope=base-system | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2Fbase-system/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # ============================================ | |
| # INTERMEDIATE LAYERS (depend on base) | |
| # ============================================ | |
| build-intermediate: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'intermediate' | |
| needs: build-base | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: [rust, go, scientific-python] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.image }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: intermediate/${{ matrix.image }}.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:latest | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:${{ github.sha }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| build-contexts: | | |
| base-system:latest=docker-image://${{ env.IMAGE_PREFIX }}/base-system:latest | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2F${{ matrix.image }}/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # CUDA intermediate (standalone, uses nvidia base) - amd64 only, NVIDIA CUDA doesn't support ARM64 | |
| build-cuda-intermediate: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'intermediate' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push cuda intermediate | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: intermediate/cuda.Dockerfile | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/cuda:latest | |
| ${{ env.IMAGE_PREFIX }}/cuda:${{ github.sha }} | |
| cache-from: type=gha,scope=cuda-intermediate | |
| cache-to: type=gha,mode=max,scope=cuda-intermediate | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2Fcuda/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Foundry intermediate (depends on rust) | |
| build-foundry-intermediate: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'intermediate' | |
| needs: build-intermediate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push foundry intermediate | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: intermediate/foundry.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/foundry:latest | |
| ${{ env.IMAGE_PREFIX }}/foundry:${{ github.sha }} | |
| cache-from: type=gha,scope=foundry-intermediate | |
| cache-to: type=gha,mode=max,scope=foundry-intermediate | |
| build-contexts: | | |
| rust:latest=docker-image://${{ env.IMAGE_PREFIX }}/rust:latest | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2Ffoundry/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # ============================================ | |
| # INFRASTRUCTURE LAYERS | |
| # ============================================ | |
| # Base-system dependent infra | |
| build-infra-base: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'infra' | |
| needs: build-base | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: | |
| - clickhouse | |
| - coinbase | |
| - coinbase_ethereum | |
| - coinbase_ethereum_solana | |
| - coinbase_polygon | |
| - convex | |
| - elasticsearch | |
| - injective | |
| - kafka | |
| - kubernetes | |
| - milvus | |
| - minio | |
| - mongodb | |
| - ollama | |
| - pgvector | |
| - postgresql | |
| - pulumi | |
| - redis | |
| - terraform | |
| - ton | |
| - universal | |
| - weaviate | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.image }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: infra/${{ matrix.image }}.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:latest | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:${{ github.sha }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| build-contexts: | | |
| base-system:latest=docker-image://${{ env.IMAGE_PREFIX }}/base-system:latest | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2F${{ matrix.image }}/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Rust dependent infra | |
| build-infra-rust: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'infra' | |
| needs: build-intermediate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: | |
| - aptos | |
| - brevis | |
| - hyperlane | |
| - hyperliquid | |
| - near | |
| - qdrant | |
| - reth | |
| - rindexer | |
| - risc0 | |
| - solana | |
| - starknet | |
| - succinct | |
| - sui | |
| - tangle | |
| - zksync | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.image }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: infra/${{ matrix.image }}.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:latest | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:${{ github.sha }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| build-contexts: | | |
| rust:latest=docker-image://${{ env.IMAGE_PREFIX }}/rust:latest | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2F${{ matrix.image }}/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Go dependent infra | |
| build-infra-go: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'infra' | |
| needs: build-intermediate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: | |
| - cosmos | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.image }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: infra/${{ matrix.image }}.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:latest | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:${{ github.sha }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| build-contexts: | | |
| go:latest=docker-image://${{ env.IMAGE_PREFIX }}/go:latest | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2F${{ matrix.image }}/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Foundry dependent infra (EVM chains) | |
| build-infra-foundry: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'infra' | |
| needs: build-foundry-intermediate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: | |
| - arbitrum | |
| - chainlink | |
| - ethereum | |
| - foundry | |
| - gelato | |
| - gnosis | |
| - hardhat | |
| - lifi | |
| - linea | |
| - monad | |
| - openzeppelin | |
| - optimism | |
| - polygon | |
| - polymer | |
| - soneium | |
| - stylus | |
| - tempo | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.image }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: infra/${{ matrix.image }}.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:latest | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:${{ github.sha }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| build-contexts: | | |
| foundry:latest=docker-image://${{ env.IMAGE_PREFIX }}/foundry:latest | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2F${{ matrix.image }}/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # CUDA dependent infra (GPU AI/ML) - amd64 only, NVIDIA CUDA doesn't support ARM64/Apple Silicon | |
| build-infra-cuda: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'infra' | |
| needs: build-cuda-intermediate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: | |
| - huggingface-gpu | |
| - pytorch-gpu | |
| - tensorflow-gpu | |
| - vllm-gpu | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.image }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: infra/${{ matrix.image }}.Dockerfile | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:latest | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:${{ github.sha }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| build-contexts: | | |
| cuda:latest=docker-image://${{ env.IMAGE_PREFIX }}/cuda:latest | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2F${{ matrix.image }}/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Scientific Python dependent infra (CPU AI/ML) | |
| build-infra-scientific-python: | |
| if: github.event_name == 'push' || inputs.layer == 'all' || inputs.layer == 'infra' | |
| needs: build-intermediate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: | |
| - chromadb | |
| - huggingface-cpu | |
| - jupyter | |
| - langchain | |
| - llamaindex | |
| - mlops | |
| - pytorch-cpu | |
| - tensorflow-cpu | |
| - vllm-cpu | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.image }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: infra/${{ matrix.image }}.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:latest | |
| ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:${{ github.sha }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| build-contexts: | | |
| scientific-python:latest=docker-image://${{ env.IMAGE_PREFIX }}/scientific-python:latest | |
| - name: Make package public | |
| run: | | |
| gh api --method PUT /orgs/${{ github.repository_owner }}/packages/container/devcontainers%2F${{ matrix.image }}/visibility \ | |
| -f visibility=public || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |