[Feature][RayJob] Use Use RayContainerIndex instead of 0 (#1427) #4
This file contains 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: operator-consistency-check | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: [ master ] | |
jobs: | |
# Check consistency between types.go and generated API. | |
ray-operator-verify-codegen: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go 1.19.x | |
uses: actions/setup-go@v2 | |
with: | |
# Use the same go version with build job | |
go-version: '1.19' | |
- name: Check golang version | |
working-directory: ./ray-operator | |
run: go version | |
- name: Verify Codegen | |
working-directory: ./ray-operator | |
run: ./hack/verify-codegen.sh | |
- name: Verify Generated Files | |
working-directory: ./ray-operator | |
run: ./hack/verify-generated-files.sh | |
# 1. Check consistency between types.go and CRD YAML files. | |
# 2. Check consistency between kubebuilder markers and RBAC. | |
ray-operator-verify-crd-rbac: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go 1.19.x | |
uses: actions/setup-go@v2 | |
with: | |
# Use the same go version with build job | |
go-version: '1.19' | |
- name: Update CRD/RBAC YAML files | |
working-directory: ./ray-operator | |
run: make manifests | |
- name: Verify Changed files | |
id: verify-changed-files | |
uses: tj-actions/[email protected] | |
with: | |
files: | | |
./config/bases/*.yaml | |
./config/rbac/*.yaml | |
- name: Check changed files | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed('Please run \"make manifests\" to synchronize CRD and RBAC!') | |
# Check consistency between CRD YAML files in ray-operator/config/crd/bases | |
# and in helm-chart/kuberay-operator/crds | |
helm-chart-verify-crd: | |
needs: ray-operator-verify-crd-rbac | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Update CRD YAML files | |
run: | | |
rm -r helm-chart/kuberay-operator/crds/ | |
cp -r ray-operator/config/crd/bases/ helm-chart/kuberay-operator/crds/ | |
- name: Verify Changed files | |
id: verify-changed-files | |
uses: tj-actions/[email protected] | |
with: | |
files: | | |
./helm-chart/kuberay-operator/crds/*.yaml | |
- name: Check changed files | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed('Please run \"make sync\" to synchronize CRDs!') | |
# Check consistency between RBAC YAML files in ray-operator/config/rbac/ | |
# and in helm-chart/kuberay-operator/templates | |
helm-chart-verify-rbac: | |
needs: ray-operator-verify-crd-rbac | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/[email protected] | |
with: | |
version: v3.9.4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
pip3 install -r scripts/requirements.txt | |
- name: Check rbac consistency | |
run: | | |
python3 scripts/rbac-check.py | |
- name: Check rbac configuration | |
run: | | |
cd helm-chart/script/ | |
pytest -s |