Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tengyifei committed Feb 10, 2025
1 parent 76d66fd commit fa419c8
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 252 deletions.
71 changes: 71 additions & 0 deletions .github/actions/e2e-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: E2E setup
description: Setup torchprime, docker, and gcloud for E2E tests
inputs:
gcp_project:
required: true
type: string
gcp_zone:
required: true
type: string
xpk_cluster_name:
required: true
type: string
tpu_type:
required: true
type: string
artifact_dir:
required: true
type: string
gcp_sa_key:
description: GCP service account key
required: true
type: string
runs:
using: "composite"
steps:
- name: Use Docker in rootless mode
uses: ScribeMD/[email protected]
- name: Add user to docker group
run: |
sudo usermod -aG docker $USER
newgrp docker
shell: bash
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
shell: bash
# Googlers: if this fails, follow http://shortn/_61iSj31q1b to debug.
- uses: google-github-actions/auth@v2
with:
credentials_json: '${{ inputs.gcp_sa_key }}'
- uses: google-github-actions/setup-gcloud@v2
with:
version: '>= 363.0.0'
install_components: 'beta,gke-gcloud-auth-plugin'
- name: Verify GCP setup
run: gcloud info
shell: bash
- name: Authenticate Docker
run: gcloud auth configure-docker --quiet
shell: bash
- name: Activate SA credentials
run: gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
shell: bash
- name: tp doctor
run: tp doctor
shell: bash
- name: tp use
run: >
tp use
--project '${{ inputs.gcp_project }}'
--zone '${{ inputs.gcp_zone }}'
--cluster '${{ inputs.xpk_cluster_name }}'
--num-slices 1
--artifact-dir '${{ inputs.artifact_dir }}'
--tpu-type '${{ inputs.tpu_type }}'
shell: bash
Loading

0 comments on commit fa419c8

Please sign in to comment.