Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into sandbox/multi-agent-c…
Browse files Browse the repository at this point in the history
…onnection
  • Loading branch information
exu committed Sep 24, 2024
2 parents fd0a50e + 0a861a1 commit e7ea0f5
Show file tree
Hide file tree
Showing 18 changed files with 197 additions and 31 deletions.
9 changes: 9 additions & 0 deletions .github/sandbox-comment-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Sandbox environment for `{{ .branch_ref }}` has been created.

## URLs

- **Dashboard**: https://dashboard.{{ .branch_ref }}.testkube.dev
- **API**: https://api.{{ .branch_ref }}.testkube.dev
- **Agent**: https://agent.{{ .branch_ref }}.testkube.dev
- **Storage**: https://storage.{{ .branch_ref }}.testkube.dev
- **Websockets**: https://websockets.{{ .branch_ref }}.testkube.dev
65 changes: 65 additions & 0 deletions .github/workflows/dispatch-sandbox-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,86 @@ on:
push:
branches:
- sandbox/**
pull_request:
types:
- opened

jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
if: startsWith(github.ref, 'refs/heads/sandbox/')
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Repository dispatch
if: startsWith(github.ref, 'refs/heads/sandbox/')
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ steps.app-token.outputs.token }}
repository: kubeshop/testkube-deployment
event-type: sandbox_agent_charts_update
client-payload: '{"ref": "${{ github.ref }}", "ref_name": "${{ github.ref_name }}", "agent_sha": "${{ github.sha }}", "repository": "${{ github.repository }}"}'

- name: Set version
if: startsWith(github.ref, 'refs/heads/sandbox/')
run: |
#get short commit sha that triggered the flow
echo git_hash="$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
# Extract everything before the first slash
branch_identifier=$(echo "$GITHUB_REF_NAME" | cut -d'/' -f2-)
# Replace slashes with dashes using sed
echo branch_identifier=$(echo "$branch_identifier" | sed 's/\//-/g') >> $GITHUB_ENV
- name: Output summary
if: startsWith(github.ref, 'refs/heads/sandbox/')
run: |
echo -e "### Sandbox Environment" >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
echo -e "## URLs" >> $GITHUB_STEP_SUMMARY
echo "- Dashboard: https://dashboard.${{ env.branch_identifier }}.testkube.dev" >> $GITHUB_STEP_SUMMARY
echo "- API: https://api.${{ env.branch_identifier }}.testkube.dev" >> $GITHUB_STEP_SUMMARY
echo "- Agent: https://agent.${{ env.branch_identifier }}.testkube.dev" >> $GITHUB_STEP_SUMMARY
echo "- Storage: https://storage.${{ env.branch_identifier }}.testkube.dev" >> $GITHUB_STEP_SUMMARY
echo "- Websockets: https://websockets.${{ env.branch_identifier }}.testkube.dev" >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
- name: Checkout
if: startsWith(github.event.pull_request.head.ref, 'sandbox/')
uses: actions/checkout@v4

- name: Get a branch name if PR is created
if: startsWith(github.event.pull_request.head.ref, 'sandbox/')
run: |
# get a branch name
branch_ref="${{ github.event.pull_request.head.ref }}"
#remove slash
branch_ref="${branch_ref#*/}"
#create env var
echo "branch_ref=$branch_ref" >> $GITHUB_ENV
- name: Render template
if: startsWith(github.event.pull_request.head.ref, 'sandbox/')
id: template
uses: chuhlomin/[email protected]
with:
template: .github/sandbox-comment-template.md
vars: |
branch_ref: ${{ env.branch_ref }}
- name: Create comment on a PR with the endpoints
if: startsWith(github.event.pull_request.head.ref, 'sandbox/')
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.CI_BOT_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.template.outputs.result }}

4 changes: 2 additions & 2 deletions charts/testkube-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: testkube-api
description: A Helm chart for Testkube api
type: application
version: 2.0.11
appVersion: 2.0.11
version: 2.1.22
appVersion: 2.1.22
dependencies:
- name: global
version: 0.1.2
Expand Down
6 changes: 1 addition & 5 deletions charts/testkube-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ spec:
- name: SLACK_TOKEN
value: "{{ .Values.slackToken }}"
{{- end }}
{{- if .Values.slackConfig }}
- name: SLACK_CONFIG
value: "{{ .Values.slackConfig }}"
{{- end }}
{{- if .Values.slackTemplate }}
- name: SLACK_TEMPLATE
value: "{{ .Values.slackTemplate }}"
Expand Down Expand Up @@ -265,7 +261,7 @@ spec:
- mountPath: /etc/testkube/certs/testkube-custom-ca.pem
name: {{ .Values.cloud.tls.customCaSecretRef }}
readOnly: true
subPath: ca.crt
subPath: {{ .Values.cloud.tls.customCaSecretKey }}
{{- end }}
{{- with .Values.additionalVolumeMounts }}
{{- toYaml . | nindent 12 -}}
Expand Down
4 changes: 3 additions & 1 deletion charts/testkube-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ cloud:
enabled: true
## Toggle should the client skip verifying the Agent API server cert in Cloud/Enterprise
skipVerify: false
## If specified, injects a custom CA into the list of trusted CAs. Specify a secret with the PEM encoded CA under the ca.crt key.
## If specified, injects a custom CA into the list of trusted CAs. Specify a secret with the PEM encoded CA under the key specified by customCaSecretKey.
customCaSecretRef: ""
## Specify the key for the PEM encoded CA in the secret specified by customCaSecretRef.
customCaSecretKey: "ca.crt"
# -- Specifies the path to the directory (skip the trailing slash) where CA certificates should be mounted. The mounted file should container a PEM encoded CA certificate.
customCaDirPath: ""
certificate:
Expand Down
4 changes: 2 additions & 2 deletions charts/testkube-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: testkube-operator
description: A Helm chart for the testkube-operator (installs needed CRDs only for now)
type: application
version: 2.0.11
appVersion: 2.0.11
version: 2.1.20
appVersion: 2.1.20
dependencies:
- name: global
version: 0.1.2
Expand Down
1 change: 1 addition & 0 deletions charts/testkube-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ A Helm chart for the testkube-operator (installs needed CRDs only for now)
| proxy.image.repository | string | `"kubebuilder/kube-rbac-proxy"` | |
| proxy.image.tag | string | `"v0.8.0"` | |
| proxy.resources | object | `{}` | |
| purgeExecutions | bool | `false` | |
| rbac.create | bool | `true` | |
| readinessProbe.initialDelaySeconds | int | `3` | |
| readinessProbe.periodSeconds | int | `10` | |
Expand Down
12 changes: 8 additions & 4 deletions charts/testkube-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ spec:
value: "{{ .Values.apiPort }}"
- name: APISERVER_TEMPLATE_CRONJOB
value: {{- if .Values.cronJobTemplate }}
"{{ toYaml .Values.cronJobTemplate | trimAll "|" | trim | indent 4 | b64enc }}"
{{- else }}
"{{ .Files.Get "cronjob-template.yml" | indent 4 | b64enc }}"
{{- end }}
"{{ .Values.cronJobTemplate | b64enc }}"
{{- else }}
"{{ .Files.Get "cronjob-template.yml" | b64enc }}"
{{- end }}
{{- if not .Values.webhook.enabled }}
- name: ENABLE_WEBHOOKS
value: "false"
Expand All @@ -98,6 +98,10 @@ spec:
value: "nats://{{ .Release.Name }}-nats"
{{- end }}
{{- end }}
{{- if .Values.purgeExecutions }}
- name: APISERVER_PURGE_EXECUTIONS
value: "true"
{{- end }}
ports:
- containerPort: 9443
name: webhook-server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ spec:
name:
description: custom execution name
type: string
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
testWorkflowExecutionName:
description: test workflow execution name started the test workflow execution
type: string
Expand Down Expand Up @@ -326,6 +331,11 @@ spec:
description: when the execution result's status has changed last time (queued, passed, failed)
format: date-time
type: string
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
testWorkflowExecutionName:
description: test workflow execution name started the test workflow execution
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -3022,6 +3025,9 @@ spec:
pattern:
description: regular expression to match
type: string
sensitive:
description: whether this value should be stored in the secret
type: boolean
type:
default: string
description: type of the parameter
Expand Down Expand Up @@ -3589,6 +3595,15 @@ spec:
type: object
type: object
type: array
execution:
description: values to be used for test workflow execution
properties:
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
type: object
job:
description: configuration for the scheduled job
properties:
Expand Down Expand Up @@ -6435,6 +6450,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -9357,6 +9375,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -10613,6 +10634,16 @@ spec:
type: string
type: object
type: array
system:
description: system configuration to define the orchestration behavior
properties:
isolatedContainers:
description: disable the behavior of merging multiple operations in a single container
type: boolean
pureByDefault:
description: assume all the steps are pure by default
type: boolean
type: object
use:
description: templates to include at a top-level of workflow
items:
Expand Down Expand Up @@ -10718,6 +10749,11 @@ spec:
description: when the execution result's status has changed last time (queued, passed, failed)
format: date-time
type: string
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
workflow:
description: TestWorkflowSummary fas TestWorkflow summary
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -2948,6 +2951,9 @@ spec:
pattern:
description: regular expression to match
type: string
sensitive:
description: whether this value should be stored in the secret
type: boolean
type:
default: string
description: type of the parameter
Expand Down Expand Up @@ -3515,6 +3521,15 @@ spec:
type: object
type: object
type: array
execution:
description: values to be used for test workflow execution
properties:
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
type: object
job:
description: configuration for the scheduled job
properties:
Expand Down Expand Up @@ -6324,6 +6339,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -9172,6 +9190,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -10371,6 +10392,16 @@ spec:
type: string
type: object
type: array
system:
description: system configuration to define the orchestration behavior
properties:
isolatedContainers:
description: disable the behavior of merging multiple operations in a single container
type: boolean
pureByDefault:
description: assume all the steps are pure by default
type: boolean
type: object
type: object
required:
- spec
Expand Down
6 changes: 4 additions & 2 deletions charts/testkube-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ apiPort: 8088
healthcheckPort: 8081
# use ArgoCD sync owner references
useArgoCDSync: false
# purge executions on CRD deletion
purgeExecutions: false

## Service Account parameters
serviceAccount:
Expand Down Expand Up @@ -196,8 +198,8 @@ webhook:
## image.pullSecret patch container image pull k8s secret name for private registries
image:
registry: docker.io
repository: dpejcev/kube-webhook-certgen
tag: 1.0.11
repository: kubeshop/kube-webhook-certgen
tag: 0.0.4
pullPolicy: IfNotPresent
pullSecrets: []
## Annotations to add to the patch Job
Expand Down
Loading

0 comments on commit e7ea0f5

Please sign in to comment.