-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update images used in testing an airgapped CKF 1.9 deployment (#1053)
* Update images for testing in airgapped * Update tf-mnist-with-summaries image used for testing in airgapped * Update file structure to support aigapped tests for both CKF 1.8 and 1.9 * Add new image for pipelines * Update tests/airgapped/README.md * Update tests/airgapped/1.9/pipelines/pipelines-runner/Dockerfile Co-authored-by: Noha Ihab <[email protected]> * Update kfp SDK version for pipelines runner * Update tests/airgapped/1.9/training/README.md Co-authored-by: Noha Ihab <[email protected]> * Update READMEs for airgapped testing * Make tests/airgap/setup/setup.sh non-interactive * Update default Juju version * Make tests/airgap/setup/setup.sh non-interactive * Remove unneeded environment variable on setup.sh * Update READMEs * Update READMEs in the scripts directory * Update README in scripts/airgapped * Update hyperlinks to get-all-images.py * Update README for the pipelines-runner image * Update for pipelines * Update airgap.sh to properly receive --testing-images-path option * Change default name for the testing images files * Update README * Update setup script to add dependencies * Remove dependencies from setup.sh * Don't exit if docker group already exists * Remove debugging echo statements * Remove README of knative --------- Co-authored-by: Noha Ihab <[email protected]>
- Loading branch information
Showing
28 changed files
with
527 additions
and
34 deletions.
There are no files selected for viewing
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
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
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
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
File renamed without changes.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Testing Pipelines in Airgapped | ||
|
||
## The `kfp-airgapped-ipynb` Notebook | ||
To test Pipelines in Airgapped, we are using the Notebook in this directory. It contains the Data passing pipeline example, with the configuration of the Pipeline components to use the `pipelines-runner` [image](./pipelines-runner/README.md). | ||
|
||
The `pipelines-runner` image will be included in your airgapped environment given that you used the [Airgapped test scripts](../../README.md). It's specifically added in the [`get-all-images.py` script](../../../../scripts/airgapped/get-all-images.py). | ||
|
||
## How to test Pipelines in an Airgapped environment | ||
1. Prepare the airgapped environment and Deploy CKF by following the steps in [Airgapped test scripts](../../README.md). | ||
2. Connect to the dashboard by visiting the IP of your airgapped VM. To get the IP run: | ||
``` | ||
lxc ls | grep eth0 | ||
``` | ||
3. Go to the `Notebooks` tab, create a new Notebook server and choose `jupyter-tensorflow-full` image from the dropdown. | ||
4. Connect to the Notebook server and upload the `kfp-airgapped-ipynb` Notebook. | ||
5. Run the Notebook. | ||
6. Click on `Run details` from the output of the last cell in the Notebook to see the status of the Pipeline run. |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Testing Katib in airgapped | ||
|
||
This directory is dedicated to testing Katib in an airgapped environment. | ||
|
||
## Prerequisites | ||
|
||
Prepare the airgapped environment and deploy CKF by following the steps in [Airgapped test scripts](https://github.com/canonical/bundle-kubeflow/tree/main/tests/airgapped#testing-airgapped-installation). | ||
|
||
Once you run the test scripts, the `kubeflowkatib/simple-pbt:v0.17.0` image used in the `simple-pbt` experiment will be included in your airgapped environment. It's specifically added in the [`get-all-images.py` script](../../../../scripts/airgapped/get-all-images.py). | ||
|
||
## How to test Katib in an Airgapped environment | ||
1. Connect to the dashboard by visiting the IP of your airgapped VM. To get the IP run: | ||
``` | ||
lxc ls | grep eth0 | ||
``` | ||
Look for the IP of the `airgapped-microk8s` instance. | ||
|
||
2. Log in to the dashboard and create a Profile. | ||
3. Go to the `Katib Experiments` tab from the dashboard sidebar. | ||
4. Click `New Experiment` then `Edit and submit YAML`. | ||
5. Paste the contents of the `simple-pbt.yaml` file found in this directory. | ||
6. Create the Experiment, and monitor its status to check it is `Succeeded`. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Source: katib/examples/v1beta1/hp-tuning/simple-pbt.yaml | ||
# This example is slightly modified from upstream to consume less resources | ||
# and disable istio sidecar. | ||
# There's a `modified` comment where we diverge from upstream. | ||
# When updating this file, make sure to keep those modifications. | ||
--- | ||
apiVersion: kubeflow.org/v1beta1 | ||
kind: Experiment | ||
metadata: | ||
name: simple-pbt | ||
spec: | ||
maxTrialCount: 1 # modified | ||
parallelTrialCount: 1 # modified | ||
maxFailedTrialCount: 1 # modified | ||
resumePolicy: FromVolume | ||
objective: | ||
type: maximize | ||
goal: 0.99 | ||
objectiveMetricName: Validation-accuracy | ||
algorithm: | ||
algorithmName: pbt | ||
algorithmSettings: | ||
- name: suggestion_trial_dir | ||
value: /var/log/katib/checkpoints/ | ||
- name: n_population | ||
value: '40' | ||
- name: truncation_threshold | ||
value: '0.2' | ||
parameters: | ||
- name: lr | ||
parameterType: double | ||
feasibleSpace: | ||
min: '0.0001' | ||
max: '0.02' | ||
step: '0.0001' | ||
trialTemplate: | ||
primaryContainerName: training-container | ||
trialParameters: | ||
- name: learningRate | ||
description: Learning rate for training the model | ||
reference: lr | ||
trialSpec: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: training-container | ||
image: 172.17.0.2:5000/kubeflowkatib/simple-pbt:v0.17.0 | ||
command: | ||
- "python3" | ||
- "/opt/pbt/pbt_test.py" | ||
- "--epochs=20" | ||
- "--lr=${trialParameters.learningRate}" | ||
- "--checkpoint=/var/log/katib/checkpoints/" | ||
resources: # modified | ||
limits: # modified | ||
memory: "2Gi" # modified | ||
cpu: "1" # modified | ||
restartPolicy: Never | ||
metadata: # modified | ||
annotations: # modified | ||
sidecar.istio.io/inject: "false" # modified |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Testing Knative in airgapped | ||
|
||
This directory is dedicated to testing Knative in an airgapped environment. | ||
|
||
## Prerequisites | ||
|
||
Prepare the airgapped environment and deploy CKF by following the steps in [Airgapped test scripts](https://github.com/canonical/bundle-kubeflow/tree/main/tests/airgapped#testing-airgapped-installation). | ||
|
||
Once you run the test scripts, the `knative/helloworld-go` image used in the `helloworld` example will be included in your airgapped environment. It's specifically added in the [`get-all-images.py` script](../../../../scripts/get-all-images.py). | ||
|
||
## How to test Knative in an Airgapped environment | ||
1. Connect to the dashboard by visiting the IP of your airgapped VM. To get the IP run: | ||
``` | ||
lxc ls | grep eth0 | ||
``` | ||
2. Log in to the dashboard and create a Profile. | ||
3. Apply the `helloworld.yaml` found in this directory to your Profile's Namespace: | ||
``` | ||
microk8s kubectl apply -f ./helloworld.yaml -n <your namespace> | ||
``` | ||
4. Wait for the Knative Service to be `Ready` | ||
``` | ||
microk8s kubectl get ksvc -n <your namespace> | ||
``` | ||
Expected output: | ||
``` | ||
NAME URL LATESTCREATED LATESTREADY READY REASON | ||
hello http://hello.admin.10.64.140.43.nip.io hello-00001 hello-00001 True | ||
``` | ||
|
||
5. Curl the Knative Service using the `URL` from the previous step | ||
``` | ||
curl -L http://hello.admin.10.64.140.43.nip.io | ||
``` | ||
Expected output: | ||
``` | ||
Hello World! | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This example is based on the [Knative Serving tutorial](https://knative.dev/docs/getting-started/first-service/#__tabbed_1_2) | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
name: hello | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
# Disable istio sidecar due to https://github.com/canonical/kserve-operators/issues/216 | ||
sidecar.istio.io/inject : "false" | ||
spec: | ||
containers: | ||
- image: 172.17.0.2:5000/knative/helloworld-go:latest | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: TARGET | ||
value: "World" |
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
Oops, something went wrong.