Some initial tests #1
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
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| name: Build and Upload Internal | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| device_type: | ||
| required: true | ||
| type: string | ||
| device_name: | ||
| required: true | ||
| type: string | ||
| cloud_runner: | ||
| required: true | ||
| type: string | ||
| build_mode: | ||
| required: true | ||
| type: string | ||
| base_image: | ||
| required: true | ||
| type: string | ||
| jobs: | ||
| build_upload: | ||
| runs-on: [self-hosted, ${{ inputs.cloud_runner }}] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Authenticate gcloud | ||
| run: | | ||
| gcloud auth configure-docker --quiet | ||
| gcloud auth configure-docker us-docker.pkg.dev --quiet | ||
| - name: Build Docker image | ||
| run: | | ||
| # Build tunix image based on the specified base image | ||
| docker build \ | ||
| --build-arg BASE_IMAGE="${{ inputs.base_image }}" \ | ||
| --build-arg DEVICE_TYPE="${{ inputs.device_type }}" \ | ||
| -t "gcr.io/tpu-prod-env-multipod/tunix_${{ github.run_id }}:${{ inputs.device_type }}" \ | ||
| -f Dockerfile.tpu \ | ||
| . | ||
| - name: Push Docker image | ||
| run: | | ||
| docker push "gcr.io/tpu-prod-env-multipod/tunix_${{ github.run_id }}:${{ inputs.device_type }}" | ||