-
Notifications
You must be signed in to change notification settings - Fork 61
Initial e2e tests #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-robot
merged 34 commits into
project-codeflare:main
from
astefanutti:pr-e2e
Jul 5, 2023
Merged
Initial e2e tests #136
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7cd925b
Initial e2e tests
astefanutti 75da2ab
test: Submit MNIST RayJob
astefanutti 3dc70d3
test: Fix RayCluster labels selector
astefanutti b824ef1
e2e: Print KubeRay operator logs
astefanutti a6011cf
test: Fix RayJob runtime environment
astefanutti aed9d26
test: Print RayJob logs
astefanutti d98ff93
test: Document how to run e2e tests locally
astefanutti 0a38102
test: Polish MNIST RayJob test
astefanutti 48a6084
test: Add MNIST training with MCAD Job
astefanutti 849a415
test: Print MNIST batch job logs
astefanutti e356b4b
test: Use RayCluster 'complete' configuration
astefanutti 9d1ad86
test: Add step log statements
astefanutti b143732
test: Add defered troubleshooting logs
astefanutti e95e08a
test: Add MNIST training in RayCluster with CodeFlare SDK
astefanutti 49563ef
test: Customize test timeouts
astefanutti 9a96e45
test: Pass MNIST training with CodeFlare SDK on OpenShift
astefanutti 12d106d
test: Print Job logs after successfull or failed completion
astefanutti ecf16dc
test: Re-use pip requirements file
astefanutti 210b102
test: Parameterize CodeFlare SDK version
astefanutti 08ed883
test: Remove ray_lightning from requirements
astefanutti 06a8659
test: Parameterize Ray image and version
astefanutti f2c6618
test: Parameterize PyTorch image
astefanutti 646876d
test: Add FIXME for SDK user base image
astefanutti 9823d64
Align go.mod with MCAD version
astefanutti 02ee9e4
test: Print Ray job logs after successful or failed completion
astefanutti 5ab5db0
test: Upload job logs
astefanutti d4d8f00
test Remove unused functions
astefanutti 99682d0
test: Fix Unexpected kind-action input
astefanutti 494afe6
test: Format test output using gotestfmt
astefanutti 7394965
test: Add codeflare stack logs to uploaded artifacts
astefanutti 2045c7a
test: Add description to e2e tests
astefanutti 9eabd95
test: Factorize e2e tests setup
astefanutti ff32292
test: Update e2e tests local run documentation
astefanutti 4463ec5
test: Write logs also for jobs that have timed out
astefanutti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
name: e2e | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- 'release-*' | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.adoc' | ||
- '**.md' | ||
- 'LICENSE' | ||
push: | ||
branches: | ||
- main | ||
- 'release-*' | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.adoc' | ||
- '**.md' | ||
- 'LICENSE' | ||
|
||
concurrency: | ||
group: ${{ github.head_ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
kubernetes: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Cleanup | ||
astefanutti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
ls -lart | ||
echo "Initial status:" | ||
df -h | ||
|
||
echo "Cleaning up resources:" | ||
sudo swapoff -a | ||
sudo rm -f /swapfile | ||
sudo apt clean | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
docker rmi $(docker image ls -aq) | ||
|
||
echo "Final status:" | ||
df -h | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Init directories | ||
run: | | ||
TEMP_DIR="$(pwd)/tmp" | ||
mkdir -p "${TEMP_DIR}" | ||
echo "TEMP_DIR=${TEMP_DIR}" >> $GITHUB_ENV | ||
|
||
mkdir -p "$(pwd)/bin" | ||
echo "$(pwd)/bin" >> $GITHUB_PATH | ||
|
||
- name: Set Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: v1.18 | ||
|
||
- name: Set up gotestfmt | ||
uses: gotesttools/gotestfmt-action@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Container image registry | ||
KPostOffice marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
podman run -d -p 5000:5000 --name registry registry:2.8.1 | ||
|
||
export REGISTRY_ADDRESS=$(hostname -i):5000 | ||
echo "REGISTRY_ADDRESS=${REGISTRY_ADDRESS}" >> $GITHUB_ENV | ||
echo "Container image registry started at ${REGISTRY_ADDRESS}" | ||
|
||
KIND_CONFIG_FILE=${{ env.TEMP_DIR }}/kind.yaml | ||
echo "KIND_CONFIG_FILE=${KIND_CONFIG_FILE}" >> $GITHUB_ENV | ||
envsubst < ./test/e2e/kind.yaml > ${KIND_CONFIG_FILE} | ||
|
||
sudo --preserve-env=REGISTRY_ADDRESS sh -c 'cat > /etc/containers/registries.conf.d/local.conf <<EOF | ||
[[registry]] | ||
prefix = "$REGISTRY_ADDRESS" | ||
insecure = true | ||
location = "$REGISTRY_ADDRESS" | ||
EOF' | ||
|
||
- name: Setup KinD cluster | ||
uses: helm/[email protected] | ||
with: | ||
cluster_name: cluster | ||
version: v0.17.0 | ||
config: ${{ env.KIND_CONFIG_FILE }} | ||
|
||
- name: Print cluster info | ||
run: | | ||
echo "KinD cluster:" | ||
kubectl cluster-info | ||
kubectl describe nodes | ||
|
||
- name: Deploy CodeFlare stack | ||
id: deploy | ||
run: | | ||
echo Deploying CodeFlare operator | ||
IMG="${REGISTRY_ADDRESS}"/codeflare-operator | ||
make image-push -e IMG="${IMG}" | ||
make deploy -e IMG="${IMG}" | ||
kubectl wait --timeout=120s --for=condition=Available=true deployment -n openshift-operators codeflare-operator-manager | ||
|
||
echo Setting up CodeFlare stack | ||
make setup-e2e | ||
|
||
- name: Run e2e tests | ||
run: | | ||
export CODEFLARE_TEST_TIMEOUT_SHORT=1m | ||
export CODEFLARE_TEST_TIMEOUT_MEDIUM=3m | ||
export CODEFLARE_TEST_TIMEOUT_LONG=8m | ||
|
||
export CODEFLARE_TEST_OUTPUT_DIR=${{ env.TEMP_DIR }} | ||
echo "CODEFLARE_TEST_OUTPUT_DIR=${CODEFLARE_TEST_OUTPUT_DIR}" >> $GITHUB_ENV | ||
|
||
set -euo pipefail | ||
go test -timeout 30m -v ./test/e2e -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt | ||
|
||
- name: Print CodeFlare operator logs | ||
if: always() && steps.deploy.outcome == 'success' | ||
run: | | ||
echo "Printing CodeFlare operator logs" | ||
kubectl logs -n openshift-operators --tail -1 -l app.kubernetes.io/name=codeflare-operator | tee ${CODEFLARE_TEST_OUTPUT_DIR}/codeflare-operator.log | ||
|
||
- name: Print MCAD controller logs | ||
if: always() && steps.deploy.outcome == 'success' | ||
run: | | ||
echo "Printing MCAD controller logs" | ||
kubectl logs -n codeflare-system --tail -1 -l component=multi-cluster-application-dispatcher | tee ${CODEFLARE_TEST_OUTPUT_DIR}/mcad.log | ||
|
||
- name: Print KubeRay operator logs | ||
if: always() && steps.deploy.outcome == 'success' | ||
run: | | ||
echo "Printing KubeRay operator logs" | ||
kubectl logs -n ray-system --tail -1 -l app.kubernetes.io/name=kuberay | tee ${CODEFLARE_TEST_OUTPUT_DIR}/kuberay.log | ||
|
||
- name: Upload logs | ||
uses: actions/upload-artifact@v3 | ||
if: always() && steps.deploy.outcome == 'success' | ||
with: | ||
name: logs | ||
retention-days: 10 | ||
path: | | ||
${{ env.CODEFLARE_TEST_OUTPUT_DIR }}/**/*.log |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# --------------------------------------------------------------------------- | ||
# Copyright 2023. | ||
# | ||
# 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 | ||
# | ||
# http://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. | ||
# --------------------------------------------------------------------------- | ||
|
||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1 | ||
kubeadmConfigPatches: | ||
- | | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
node-labels: "ingress-ready=true" | ||
containerdConfigPatches: | ||
- |- | ||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."${REGISTRY_ADDRESS}"] | ||
endpoint = ["http://${REGISTRY_ADDRESS}"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.