Skip to content

Commit

Permalink
test: git clone containerfile now uses self signed certs
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdelahunt committed Apr 4, 2024
1 parent 2660f62 commit cdc0238
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ GO=go
GOFLAGS=""

# requires:
# AWS_SECRET_ACCESS_KEY - Secret from AWS
# AWS_SECRET_ACCESS_KEY - Secret from AWS
# AWS_ACCESS_KEY_ID - Access key from AWS
# S3_REGION - Region of the bucket used to store the model
# S3_ENDPOINT - Endpint of the bucket
# IMAGE_REGISTRY_USERNAME - quay.io username
# IMAGE_REGISTRY_PASSWORD - quay.io password
# SELF_SIGNED_CERT - Self signed cert to be used in pipeline (optional)
# S3_REGION - Region of the bucket used to store the model
# S3_ENDPOINT - Endpint of the bucket
# IMAGE_REGISTRY_USERNAME - quay.io username
# IMAGE_REGISTRY_PASSWORD - quay.io password
# SELF_SIGNED_CERT - Local path to the self signed cert to be used in pipeline (optional)
go-test-setup:
ifndef AWS_SECRET_ACCESS_KEY
$(error AWS_SECRET_ACCESS_KEY is undefined)
Expand Down Expand Up @@ -76,10 +76,10 @@ endif
oc secret link pipeline credentials-image-registry

# requires:
# S3_BUCKET - Name of S3 bucket that contains the models
# NAMESPACE - Cluster namespace that tests are run in
# S3_BUCKET - Name of S3 bucket that contains the models
# NAMESPACE - Cluster namespace that tests are run in
# TARGET_IMAGE_TAGS_JSON - JSON array of image tags that the final image will be pushed to. E.g. '["quay.io/user/model-name:e2e-test"]'
# SELF_SIGNED_CERT - Self signed cert to be used in pipeline (optional)
# SELF_SIGNED_CERT - Local path to the self signed cert to be used in pipeline (optional)
go-test:
ifndef S3_BUCKET
$(error S3_BUCKET is undefined)
Expand Down
2 changes: 2 additions & 0 deletions pipelines/tekton/aiedge-e2e/aiedge-e2e.pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ spec:
workspace: build-workspace-pv
- name: basic-auth
workspace: git-basic-auth
- name: ssl-ca-directory
workspace: ssl-certs
- name: check-model-and-containerfile-exists
params:
- name: model-name
Expand Down
18 changes: 10 additions & 8 deletions test/e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A local install of the Go compiler is needed to run the tests. Go version `1.21`
- Log into the target cluster using `oc login`. This will update your default `kubeconfig` for the tests to use
- Create a S3 bucket with the models in the root directory

The following enviroment varaibles are required to run the test setup and the tests themselves. If any of these are not set then the tests will not run. Read [here](../../pipelines/README.md#ai-edge-end-to-end-pipeline) for more context on how to set these up.
The following enviroment variables are required to run the test setup and the tests themselves. If any of these are not set then the tests will not run. Read [here](../../pipelines/README.md#ai-edge-end-to-end-pipeline) for more context on how to set these up.

- `AWS_SECRET_ACCESS_KEY` - Secret from AWS
- `AWS_ACCESS_KEY_ID` - Access key from AWS
Expand All @@ -17,8 +17,9 @@ The following enviroment varaibles are required to run the test setup and the te
- `IMAGE_REGISTRY_USERNAME` - quay.io username
- `IMAGE_REGISTRY_PASSWORD` - quay.io password

The following enviroment varaibles are optional. You may still need to set them for the tests to pass depending on your setup. Read [here](../../pipelines/README.md#ai-edge-end-to-end-pipeline) for more context on how to set these up.
- `SELF_SIGNED_CERT` - Path self signed cert to be used in pipeline
The following enviroment variables are optional. You may still need to set them for the tests to pass depending on your setup. Read [here](../../pipelines/README.md#ai-edge-end-to-end-pipeline) for more context on how to set these up.

- `SELF_SIGNED_CERT` - A path on your local machine to a self signed cert to be used in pipeline


```bash
Expand All @@ -27,22 +28,23 @@ make go-test-setup

## Run tests locally

The following enviroment varaibles are required to run the tests. If any of these are not set then the tests will not run. Read [here](../../pipelines/README.md#ai-edge-end-to-end-pipeline) for more context on how to set these up.
The following enviroment variables are required to run the tests. If any of these are not set then the tests will not run. Read [here](../../pipelines/README.md#ai-edge-end-to-end-pipeline) for more context on how to set these up.

- `S3_BUCKET` - Name of S3 bucket that contains the models
- `NAMESPACE` - Cluster namespace that tests are run in
- `TARGET_IMAGE_TAGS_JSON` - JSON array of image tags that the final image will be pushed to. E.g. '["quay.io/user/model-name:e2e-test"]'

The following enviroment varaibles are optional. You may still need to set them for the tests to pass depending on your setup. Read [here](../../pipelines/README.md#ai-edge-end-to-end-pipeline) for more context on how to set these up.
- `SELF_SIGNED_CERT` - Path self signed cert to be used in pipeline
- `GO` - Custom Go installation path that is not used in `PATH`
The following enviroment variables are optional. You may still need to set them for the tests to pass depending on your setup. Read [here](../../pipelines/README.md#ai-edge-end-to-end-pipeline) for more context on how to set these up.

- `SELF_SIGNED_CERT` - A path on your local machine to a self signed cert to be used in pipeline
- `GO` - Custom Go installation path that is not set in your `PATH`

```bash
make go-test
```
Set the go binary used for testing that is in your `PATH`
```bash
make go-test
make GO=go1.19 go-test
```

## CI/CD with Github Actions
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-tests/support/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func setOptions() (*Options, error) {
}

if options.SelfSignedCert = os.Getenv(SelfSignedCertEnvKey); options.SelfSignedCert == "" {
fmt.Printf("optional env variable %v not set, set it to use self signed certs", SelfSignedCertEnvKey)
fmt.Printf("optional env variable %v not set, set it to use self signed certs\n", SelfSignedCertEnvKey)
}

return options, nil
Expand Down

0 comments on commit cdc0238

Please sign in to comment.