From b15f40104a9932b5a8495e4206e13ddc39488144 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 09:54:43 -0700 Subject: [PATCH 01/40] add helm lint and shallow test --- .github/workflows/chart-ci.yaml | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/chart-ci.yaml diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml new file mode 100644 index 00000000..511ede80 --- /dev/null +++ b/.github/workflows/chart-ci.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +name: Helm Chart CI +on: + pull_request: null + merge_group: null +permissions: read-all +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: azure/setup-helm@v4.2.0 + - uses: actions/setup-python@v5 + - name: Setup chart-testing + uses: helm/chart-testing-action@v2.6.1 + - name: Get chart diff + id: changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: lint + if: steps.changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} + - uses: helm/kind-action@v1.10.0 + if: steps.changed.outputs.changed == 'true' + - name: test + if: steps.changed.outputs.changed == 'true' + run: ct install --target-branch ${{ github.event.repository.default_branch }} From 961c1af968abce62e8c783062c41b8683653c362 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 13:44:37 -0700 Subject: [PATCH 02/40] add cart testing config file --- .github/ct.yaml | 21 +++++++++++++++++++++ .github/workflows/chart-ci.yaml | 8 ++++---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .github/ct.yaml diff --git a/.github/ct.yaml b/.github/ct.yaml new file mode 100644 index 00000000..c223fe01 --- /dev/null +++ b/.github/ct.yaml @@ -0,0 +1,21 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +# See https://github.com/helm/chart-testing#configuration +remote: origin +target-branch: main +chart-dirs: + - workflows/charts +chart-repos: null +helm-extra-args: null diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 511ede80..d120f737 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -21,7 +21,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - lint-test: + helm-ci: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -34,15 +34,15 @@ jobs: - name: Get chart diff id: changed run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml) if [[ -n "$changed" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" fi - name: lint if: steps.changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} + run: ct lint --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml - uses: helm/kind-action@v1.10.0 if: steps.changed.outputs.changed == 'true' - name: test if: steps.changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} + run: ct install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml From d1d1c5f14fdfce41401b5aef3fc2da35b479b3c1 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 13:47:25 -0700 Subject: [PATCH 03/40] add test chart --- workflows/charts/test/.helmignore | 23 ++++ workflows/charts/test/Chart.yaml | 38 ++++++ workflows/charts/test/templates/NOTES.txt | 22 ++++ workflows/charts/test/templates/_helpers.tpl | 62 ++++++++++ .../charts/test/templates/deployment.yaml | 86 ++++++++++++++ workflows/charts/test/templates/hpa.yaml | 46 +++++++ workflows/charts/test/templates/ingress.yaml | 75 ++++++++++++ workflows/charts/test/templates/service.yaml | 29 +++++ .../charts/test/templates/serviceaccount.yaml | 27 +++++ .../test/templates/tests/test-connection.yaml | 29 +++++ workflows/charts/test/values.yaml | 112 ++++++++++++++++++ 11 files changed, 549 insertions(+) create mode 100644 workflows/charts/test/.helmignore create mode 100644 workflows/charts/test/Chart.yaml create mode 100644 workflows/charts/test/templates/NOTES.txt create mode 100644 workflows/charts/test/templates/_helpers.tpl create mode 100644 workflows/charts/test/templates/deployment.yaml create mode 100644 workflows/charts/test/templates/hpa.yaml create mode 100644 workflows/charts/test/templates/ingress.yaml create mode 100644 workflows/charts/test/templates/service.yaml create mode 100644 workflows/charts/test/templates/serviceaccount.yaml create mode 100644 workflows/charts/test/templates/tests/test-connection.yaml create mode 100644 workflows/charts/test/values.yaml diff --git a/workflows/charts/test/.helmignore b/workflows/charts/test/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/workflows/charts/test/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/workflows/charts/test/Chart.yaml b/workflows/charts/test/Chart.yaml new file mode 100644 index 00000000..d545bdef --- /dev/null +++ b/workflows/charts/test/Chart.yaml @@ -0,0 +1,38 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +apiVersion: v2 +name: chart-test +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/workflows/charts/test/templates/NOTES.txt b/workflows/charts/test/templates/NOTES.txt new file mode 100644 index 00000000..dc291380 --- /dev/null +++ b/workflows/charts/test/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "huggingface-llm.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "huggingface-llm.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "huggingface-llm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "huggingface-llm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/workflows/charts/test/templates/_helpers.tpl b/workflows/charts/test/templates/_helpers.tpl new file mode 100644 index 00000000..187797f7 --- /dev/null +++ b/workflows/charts/test/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "huggingface-llm.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "huggingface-llm.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "huggingface-llm.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "huggingface-llm.labels" -}} +helm.sh/chart: {{ include "huggingface-llm.chart" . }} +{{ include "huggingface-llm.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "huggingface-llm.selectorLabels" -}} +app.kubernetes.io/name: {{ include "huggingface-llm.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "huggingface-llm.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "huggingface-llm.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/workflows/charts/test/templates/deployment.yaml b/workflows/charts/test/templates/deployment.yaml new file mode 100644 index 00000000..55f08d2e --- /dev/null +++ b/workflows/charts/test/templates/deployment.yaml @@ -0,0 +1,86 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "huggingface-llm.fullname" . }} + labels: + {{- include "huggingface-llm.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "huggingface-llm.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "huggingface-llm.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "huggingface-llm.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/workflows/charts/test/templates/hpa.yaml b/workflows/charts/test/templates/hpa.yaml new file mode 100644 index 00000000..21fe0060 --- /dev/null +++ b/workflows/charts/test/templates/hpa.yaml @@ -0,0 +1,46 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "huggingface-llm.fullname" . }} + labels: + {{- include "huggingface-llm.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "huggingface-llm.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/workflows/charts/test/templates/ingress.yaml b/workflows/charts/test/templates/ingress.yaml new file mode 100644 index 00000000..afda4333 --- /dev/null +++ b/workflows/charts/test/templates/ingress.yaml @@ -0,0 +1,75 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "huggingface-llm.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "huggingface-llm.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/workflows/charts/test/templates/service.yaml b/workflows/charts/test/templates/service.yaml new file mode 100644 index 00000000..7dd1e602 --- /dev/null +++ b/workflows/charts/test/templates/service.yaml @@ -0,0 +1,29 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "huggingface-llm.fullname" . }} + labels: + {{- include "huggingface-llm.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "huggingface-llm.selectorLabels" . | nindent 4 }} diff --git a/workflows/charts/test/templates/serviceaccount.yaml b/workflows/charts/test/templates/serviceaccount.yaml new file mode 100644 index 00000000..bd6f5294 --- /dev/null +++ b/workflows/charts/test/templates/serviceaccount.yaml @@ -0,0 +1,27 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "huggingface-llm.serviceAccountName" . }} + labels: + {{- include "huggingface-llm.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/workflows/charts/test/templates/tests/test-connection.yaml b/workflows/charts/test/templates/tests/test-connection.yaml new file mode 100644 index 00000000..fef15191 --- /dev/null +++ b/workflows/charts/test/templates/tests/test-connection.yaml @@ -0,0 +1,29 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "huggingface-llm.fullname" . }}-test-connection" + labels: + {{- include "huggingface-llm.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "huggingface-llm.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/workflows/charts/test/values.yaml b/workflows/charts/test/values.yaml new file mode 100644 index 00000000..837e23d7 --- /dev/null +++ b/workflows/charts/test/values.yaml @@ -0,0 +1,112 @@ +# Copyright (c) 2024 Intel Corporation +# +# 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. + +# Default values for huggingface-llm. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} From a38629ffd2c316042a5debc8415cbd4540ab8f36 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 14:07:56 -0700 Subject: [PATCH 04/40] add pre-commit check --- .pre-commit-config.yaml | 7 ++++++- CONTRIBUTING.md | 5 ++++- workflows/charts/dev-requirements.txt | 2 ++ workflows/charts/test/Chart.yaml | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 workflows/charts/dev-requirements.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b08c6ba1..c7770a8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: autofix_prs: true autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" autoupdate_schedule: "weekly" - skip: [pylint, shellcheck, markdownlint, hadolint-docker, shfmt, tox, mkdocs] + skip: [pylint, shellcheck, markdownlint, hadolint-docker, shfmt, tox, mkdocs, ct] repos: - hooks: - id: check-added-large-files @@ -78,4 +78,9 @@ repos: id: mkdocs language: system name: mkdocs + - entry: ct lint --config .github/ct.yaml + files: ^workflows/charts/ + id: ct + language: system + name: ct repo: local diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bfbafbfb..a1d452b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,10 @@ This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT. 2. Create a new branch for your contribution: `git checkout -b feature/your-feature`. 3. Install [pre-commit](https://pre-commit.com/), [Docker](https://docs.docker.com/engine/install/), and [Python 3.8+](https://www.python.org/downloads/). 4. Follow the [Project Setup](README.md#project-setup) steps. -5. Install the third-party python dependencies necessary for pre-commit with `pip install -r test-runner/dev-requirements.txt && pip install -r docs/requirements.txt`. +5. Install the third-party python dependencies necessary for pre-commit depending on the type of contribution you are making: + 1. If you are contributing to Test Runner, run `pip install -r test-runner/dev-requirements.txt`. + 2. If you are contributing to documentation, run `pip install -r docs/requirements.txt`. (This hook will always run) + 3. If you are contributing to helm charts, run `pip install -r workflows/charts/dev-requirements.txt`. Install [Helm](https://helm.sh/docs/intro/install/) and then [Chart Testing](https://github.com/helm/chart-testing) tool. 6. Make your changes, commit, and sign your changes: `git commit -s -m 'Add your feature'`. 7. Push to the branch: `git push origin feature/your-feature`. 8. Submit a pull request. diff --git a/workflows/charts/dev-requirements.txt b/workflows/charts/dev-requirements.txt new file mode 100644 index 00000000..7d9010ae --- /dev/null +++ b/workflows/charts/dev-requirements.txt @@ -0,0 +1,2 @@ +yamllint>=1.15.1 +yamale>=5.2.1 diff --git a/workflows/charts/test/Chart.yaml b/workflows/charts/test/Chart.yaml index d545bdef..76e8468a 100644 --- a/workflows/charts/test/Chart.yaml +++ b/workflows/charts/test/Chart.yaml @@ -24,6 +24,10 @@ description: A Helm chart for Kubernetes # Library charts provide useful utilities or functions for the chart developer. They're included as # a dependency of application charts to inject those utilities and functions into the rendering # pipeline. Library charts do not define any templates and therefore cannot be deployed. +maintainers: + - name: tylertitsworth + email: tyler.titsworth@intel.com + url: https://github.com/tylertitsworth type: application # This is the chart version. This version number should be incremented each time you make changes From fae038ade252e97229f6f7df8b1689aab993aa09 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 15:28:49 -0700 Subject: [PATCH 05/40] update chart --- .github/ct.yaml | 4 +- .github/dependabot.yml | 8 ++ .github/workflows/chart-ci.yaml | 11 +-- workflows/charts/dev-requirements.txt | 2 +- workflows/charts/test/templates/NOTES.txt | 16 ++-- workflows/charts/test/templates/_helpers.tpl | 20 ++--- .../charts/test/templates/deployment.yaml | 51 ++----------- workflows/charts/test/templates/hpa.yaml | 46 ------------ workflows/charts/test/templates/ingress.yaml | 75 ------------------- workflows/charts/test/templates/service.yaml | 6 +- .../charts/test/templates/serviceaccount.yaml | 7 +- .../test/templates/tests/test-connection.yaml | 6 +- workflows/charts/test/values.yaml | 73 +----------------- 13 files changed, 46 insertions(+), 279 deletions(-) delete mode 100644 workflows/charts/test/templates/hpa.yaml delete mode 100644 workflows/charts/test/templates/ingress.yaml diff --git a/.github/ct.yaml b/.github/ct.yaml index c223fe01..117b4ad9 100644 --- a/.github/ct.yaml +++ b/.github/ct.yaml @@ -13,9 +13,9 @@ # limitations under the License. # See https://github.com/helm/chart-testing#configuration + remote: origin target-branch: main chart-dirs: - workflows/charts -chart-repos: null -helm-extra-args: null +helm-extra-args: --timeout 30s diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e70a7396..cfa9037d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -71,3 +71,11 @@ updates: package-ecosystem: pip schedule: interval: weekly + - directory: /workflows + groups: + helm: + patterns: + - "*" + package-ecosystem: pip + schedule: + interval: weekly diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index d120f737..4c4cf4d6 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -22,7 +22,7 @@ concurrency: cancel-in-progress: true jobs: helm-ci: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # kubectl steps: - uses: actions/checkout@v4 with: @@ -38,11 +38,8 @@ jobs: if [[ -n "$changed" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" fi - - name: lint + - uses: helm/kind-action@v1.10.0 # To be Removed if: steps.changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml - - uses: helm/kind-action@v1.10.0 + - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' - - name: test - if: steps.changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml + run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug diff --git a/workflows/charts/dev-requirements.txt b/workflows/charts/dev-requirements.txt index 7d9010ae..9096ab43 100644 --- a/workflows/charts/dev-requirements.txt +++ b/workflows/charts/dev-requirements.txt @@ -1,2 +1,2 @@ -yamllint>=1.15.1 yamale>=5.2.1 +yamllint>=1.15.1 diff --git a/workflows/charts/test/templates/NOTES.txt b/workflows/charts/test/templates/NOTES.txt index dc291380..4d1369ea 100644 --- a/workflows/charts/test/templates/NOTES.txt +++ b/workflows/charts/test/templates/NOTES.txt @@ -1,21 +1,15 @@ 1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "huggingface-llm.fullname" . }}) +{{- if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "chart-test.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "huggingface-llm.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "huggingface-llm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "chart-test.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "chart-test.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "huggingface-llm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "chart-test.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT diff --git a/workflows/charts/test/templates/_helpers.tpl b/workflows/charts/test/templates/_helpers.tpl index 187797f7..9e23fffb 100644 --- a/workflows/charts/test/templates/_helpers.tpl +++ b/workflows/charts/test/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "huggingface-llm.name" -}} +{{- define "chart-test.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "huggingface-llm.fullname" -}} +{{- define "chart-test.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "huggingface-llm.chart" -}} +{{- define "chart-test.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "huggingface-llm.labels" -}} -helm.sh/chart: {{ include "huggingface-llm.chart" . }} -{{ include "huggingface-llm.selectorLabels" . }} +{{- define "chart-test.labels" -}} +helm.sh/chart: {{ include "chart-test.chart" . }} +{{ include "chart-test.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "huggingface-llm.selectorLabels" -}} -app.kubernetes.io/name: {{ include "huggingface-llm.name" . }} +{{- define "chart-test.selectorLabels" -}} +app.kubernetes.io/name: {{ include "chart-test.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "huggingface-llm.serviceAccountName" -}} +{{- define "chart-test.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "huggingface-llm.fullname" .) .Values.serviceAccount.name }} +{{- default (include "chart-test.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/workflows/charts/test/templates/deployment.yaml b/workflows/charts/test/templates/deployment.yaml index 55f08d2e..05174bb2 100644 --- a/workflows/charts/test/templates/deployment.yaml +++ b/workflows/charts/test/templates/deployment.yaml @@ -15,44 +15,27 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "huggingface-llm.fullname" . }} + name: {{ include "chart-test.fullname" . }} labels: - {{- include "huggingface-llm.labels" . | nindent 4 }} + {{- include "chart-test.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} - {{- end }} selector: matchLabels: - {{- include "huggingface-llm.selectorLabels" . | nindent 6 }} + {{- include "chart-test.selectorLabels" . | nindent 6 }} template: metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} labels: - {{- include "huggingface-llm.labels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} + {{- include "chart-test.selectorLabels" . | nindent 8 }} spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "huggingface-llm.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + serviceAccountName: {{ include "chart-test.serviceAccountName" . }} containers: - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http - containerPort: {{ .Values.service.port }} + containerPort: 80 protocol: TCP livenessProbe: httpGet: @@ -62,25 +45,3 @@ spec: httpGet: path: / port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.volumeMounts }} - volumeMounts: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.volumes }} - volumes: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/workflows/charts/test/templates/hpa.yaml b/workflows/charts/test/templates/hpa.yaml deleted file mode 100644 index 21fe0060..00000000 --- a/workflows/charts/test/templates/hpa.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2024 Intel Corporation -# -# 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. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "huggingface-llm.fullname" . }} - labels: - {{- include "huggingface-llm.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "huggingface-llm.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/workflows/charts/test/templates/ingress.yaml b/workflows/charts/test/templates/ingress.yaml deleted file mode 100644 index afda4333..00000000 --- a/workflows/charts/test/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (c) 2024 Intel Corporation -# -# 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. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "huggingface-llm.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "huggingface-llm.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/workflows/charts/test/templates/service.yaml b/workflows/charts/test/templates/service.yaml index 7dd1e602..2a5d21f8 100644 --- a/workflows/charts/test/templates/service.yaml +++ b/workflows/charts/test/templates/service.yaml @@ -15,9 +15,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "huggingface-llm.fullname" . }} + name: {{ include "chart-test.fullname" . }} labels: - {{- include "huggingface-llm.labels" . | nindent 4 }} + {{- include "chart-test.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: @@ -26,4 +26,4 @@ spec: protocol: TCP name: http selector: - {{- include "huggingface-llm.selectorLabels" . | nindent 4 }} + {{- include "chart-test.selectorLabels" . | nindent 4 }} diff --git a/workflows/charts/test/templates/serviceaccount.yaml b/workflows/charts/test/templates/serviceaccount.yaml index bd6f5294..52ecc7b5 100644 --- a/workflows/charts/test/templates/serviceaccount.yaml +++ b/workflows/charts/test/templates/serviceaccount.yaml @@ -12,16 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- if .Values.serviceAccount.create -}} +{{if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "huggingface-llm.serviceAccountName" . }} + name: {{ include "chart-test.serviceAccountName" . }} labels: - {{- include "huggingface-llm.labels" . | nindent 4 }} + {{- include "chart-test.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} {{- end }} diff --git a/workflows/charts/test/templates/tests/test-connection.yaml b/workflows/charts/test/templates/tests/test-connection.yaml index fef15191..da0991b5 100644 --- a/workflows/charts/test/templates/tests/test-connection.yaml +++ b/workflows/charts/test/templates/tests/test-connection.yaml @@ -15,9 +15,9 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "huggingface-llm.fullname" . }}-test-connection" + name: "{{ include "chart-test.fullname" . }}-test-connection" labels: - {{- include "huggingface-llm.labels" . | nindent 4 }} + {{- include "chart-test.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: @@ -25,5 +25,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['{{ include "huggingface-llm.fullname" . }}:{{ .Values.service.port }}'] + args: ['{{ include "chart-test.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never diff --git a/workflows/charts/test/values.yaml b/workflows/charts/test/values.yaml index 837e23d7..479b2dd3 100644 --- a/workflows/charts/test/values.yaml +++ b/workflows/charts/test/values.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Default values for huggingface-llm. +# Default values for chart-test. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -24,89 +24,18 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "" -imagePullSecrets: [] nameOverride: "" fullnameOverride: "" serviceAccount: # Specifies whether a service account should be created create: true - # Automatically mount a ServiceAccount's API credentials? - automount: true # Annotations to add to the service account annotations: {} # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template name: "" -podAnnotations: {} -podLabels: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - service: type: ClusterIP port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -# Additional volumes on the output Deployment definition. -volumes: [] -# - name: foo -# secret: -# secretName: mysecret -# optional: false - -# Additional volumeMounts on the output Deployment definition. -volumeMounts: [] -# - name: foo -# mountPath: "/etc/foo" -# readOnly: true - -nodeSelector: {} - -tolerations: [] - -affinity: {} From a5a23dda5c4b0fbcaa96d553c0393a2b6122065c Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 15:32:21 -0700 Subject: [PATCH 06/40] update codeowners --- .github/CODEOWNERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c2c33718..2ec67b3e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,10 @@ .github/* @tylertitsworth +classical-ml/* @tylertitsworth @jitendra42 @sramakintel @sharvil10 docs/* @tylertitsworth @jitendra42 +enterprise/* @sharvil10 preset/* @ma-pineda @jafraustro +pytorch/* @tylertitsworth @jitendra42 @sramakintel @sharvil10 +tensorflow/* @tylertitsworth @jitendra42 @sramakintel @sharvil10 test-runner/* @tylertitsworth +workflows/* @tylertitsworth * @tylertitsworth @jitendra42 From 5452df1e028473325b7567479a16ed043a31684d Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 15:50:39 -0700 Subject: [PATCH 07/40] update yamllint filter --- .github/linters/.yaml-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml index 6c2a65c3..16898da4 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.github/linters/.yaml-lint.yml @@ -13,4 +13,4 @@ # limitations under the License. --- -ignore: '**/templates/**.yaml' +ignore: 'workflows/charts/' From 19396c1d9470da935a033d88af4205763660ec6f Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 15:51:47 -0700 Subject: [PATCH 08/40] specify namespace --- .github/workflows/chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 4c4cf4d6..841cd062 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -42,4 +42,4 @@ jobs: if: steps.changed.outputs.changed == 'true' - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' - run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug + run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci From b7e06e5aa5da8aeb32a36259b9b1d6500b8c4ab3 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 15:54:30 -0700 Subject: [PATCH 09/40] wait on namespace specification --- .github/workflows/chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 841cd062..66970220 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -42,4 +42,4 @@ jobs: if: steps.changed.outputs.changed == 'true' - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' - run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci + run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug # --namespace helm-ci From d4c7112b72251c33300d057baa725c560c3687b2 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:07:14 -0700 Subject: [PATCH 10/40] return timeout --- .github/ct.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ct.yaml b/.github/ct.yaml index 117b4ad9..cc8a17cf 100644 --- a/.github/ct.yaml +++ b/.github/ct.yaml @@ -18,4 +18,4 @@ remote: origin target-branch: main chart-dirs: - workflows/charts -helm-extra-args: --timeout 30s +helm-extra-args: --timeout 600s From 9b02a1b3e18d35ef2b0aa935d929c5775f9db815 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:18:39 -0700 Subject: [PATCH 11/40] test on prod --- .github/workflows/chart-ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 66970220..48c2d9aa 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -22,7 +22,7 @@ concurrency: cancel-in-progress: true jobs: helm-ci: - runs-on: ubuntu-latest # kubectl + runs-on: kubectl steps: - uses: actions/checkout@v4 with: @@ -38,8 +38,6 @@ jobs: if [[ -n "$changed" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" fi - - uses: helm/kind-action@v1.10.0 # To be Removed - if: steps.changed.outputs.changed == 'true' - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' - run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug # --namespace helm-ci + run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci From 5fd089536e5436273e563ef9e704c2e49173520d Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:20:17 -0700 Subject: [PATCH 12/40] add python version --- .github/workflows/chart-ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 48c2d9aa..81753ab1 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -29,6 +29,8 @@ jobs: fetch-depth: 0 - uses: azure/setup-helm@v4.2.0 - uses: actions/setup-python@v5 + with: + python-version: 3.x - name: Setup chart-testing uses: helm/chart-testing-action@v2.6.1 - name: Get chart diff From 3aa58f7ad0c61689d07e8d7c05018fb947d89f4c Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:24:24 -0700 Subject: [PATCH 13/40] add kubeconfig --- .github/workflows/chart-ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 81753ab1..f339b587 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -14,7 +14,7 @@ name: Helm Chart CI on: - pull_request: null + pull_request_target: null merge_group: null permissions: read-all concurrency: @@ -43,3 +43,5 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci + env: + KUBECONFIG: ${{ secrets.KUBECONFIG_PATH }} From 33c15a199d678f003d6f750152c2855eb3b1ccc7 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:26:26 -0700 Subject: [PATCH 14/40] remove target --- .github/workflows/chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index f339b587..6b3daf2c 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -14,7 +14,7 @@ name: Helm Chart CI on: - pull_request_target: null + pull_request: null merge_group: null permissions: read-all concurrency: From 71d05231dfd9c5b6ce68815d3fc243a32d9978a1 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:30:57 -0700 Subject: [PATCH 15/40] add kubectl path --- .github/workflows/chart-ci.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 6b3daf2c..4022db6a 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -20,6 +20,9 @@ permissions: read-all concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + PATH: ${{ secrets.KUBECTL_PATH }}:$PATH + KUBECONFIG: ${{ secrets.KUBECONFIG_PATH }} jobs: helm-ci: runs-on: kubectl @@ -43,5 +46,3 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci - env: - KUBECONFIG: ${{ secrets.KUBECONFIG_PATH }} From db6fd6b4b114444c64f31cdc0159ea74653ac8d0 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:37:19 -0700 Subject: [PATCH 16/40] update context --- .github/workflows/chart-ci.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 4022db6a..cd8214be 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -20,9 +20,6 @@ permissions: read-all concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - PATH: ${{ secrets.KUBECTL_PATH }}:$PATH - KUBECONFIG: ${{ secrets.KUBECONFIG_PATH }} jobs: helm-ci: runs-on: kubectl @@ -45,4 +42,9 @@ jobs: fi - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' - run: ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci + run: | + echo "${{ secrets.KUBECTL_PATH }}" >> $GITHUB_PATH + kubectl config use-context kubeflow + ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci + env: + KUBECONFIG: ${{ secrets.KUBECONFIG_PATH }} From 0da5bad8b45325581562dfffaccdfff9bc70a69f Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:43:25 -0700 Subject: [PATCH 17/40] cp instead of set at actions level --- .github/workflows/chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index cd8214be..dcc521de 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -43,7 +43,7 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | - echo "${{ secrets.KUBECTL_PATH }}" >> $GITHUB_PATH + cp {{ secrets.KUBECTL_PATH }}/kubectl /usr/local/bin/kubectl kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: From 5edec3c3373e1d03b186f536a48172b4a5bf955b Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:45:20 -0700 Subject: [PATCH 18/40] add usr bin --- .github/workflows/chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index dcc521de..0052c19c 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -43,7 +43,7 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | - cp {{ secrets.KUBECTL_PATH }}/kubectl /usr/local/bin/kubectl + cp {{ secrets.KUBECTL_PATH }}/kubectl /usr/bin/kubectl kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: From cd67a48cb5de2be30e821f4dbbd163c1476d902a Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Wed, 29 May 2024 16:47:39 -0700 Subject: [PATCH 19/40] use action instead --- .github/workflows/chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 0052c19c..0e759d36 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -27,6 +27,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: azure/setup-kubectl@v4 - uses: azure/setup-helm@v4.2.0 - uses: actions/setup-python@v5 with: @@ -43,7 +44,6 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | - cp {{ secrets.KUBECTL_PATH }}/kubectl /usr/bin/kubectl kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: From 2273d5327137f719ce34b21170276ae557c1fb04 Mon Sep 17 00:00:00 2001 From: Tyler Titsworth Date: Thu, 30 May 2024 08:14:58 -0700 Subject: [PATCH 20/40] Use Pull Request Target for PRs (#62) --- .github/workflows/container-ci.yaml | 17 +++++ .github/workflows/dependency-review.yaml | 10 +-- .github/workflows/dockerhub-description.yml | 24 +++---- .github/workflows/docs.yaml | 30 ++++---- .github/workflows/gitleaks.yaml | 21 +++--- .github/workflows/integration-test.yaml | 80 +++++++++++---------- .github/workflows/lint.yaml | 43 +++++------ .github/workflows/scorecard.yaml | 38 +++++----- .github/workflows/test-runner-ci.yaml | 12 +++- .github/workflows/weekly-test.yaml | 27 +++---- 10 files changed, 167 insertions(+), 135 deletions(-) diff --git a/.github/workflows/container-ci.yaml b/.github/workflows/container-ci.yaml index 34c91557..8afc941c 100644 --- a/.github/workflows/container-ci.yaml +++ b/.github/workflows/container-ci.yaml @@ -35,6 +35,10 @@ on: description: 'Enter Bash Env Variable Overrides in `KEY=VAL KEY2=VAL2` format:' required: false type: string + ref: + description: 'Enter Git Ref:' + required: true + type: string runner_label: description: 'Enter Validation Runner Label:' default: test-runner @@ -66,6 +70,9 @@ on: no_start: required: false type: boolean + ref: + required: true + type: string jobs: #################################################################################################### # Compose Build @@ -76,6 +83,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} - name: Set Matrix id: build-matrix run: echo "matrix=$(jq -c . < ${{ inputs.group_dir }}/.actions.json)" >> $GITHUB_OUTPUT @@ -93,6 +102,8 @@ jobs: group: ${{ steps.build-group.outputs.container-group }} steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} if: ${{ !inputs.no_build }} - uses: docker/login-action@v3 with: @@ -136,6 +147,8 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} - uses: docker/login-action@v3 with: registry: ${{ secrets.REGISTRY }} @@ -164,6 +177,8 @@ jobs: matrix: ${{ steps.test-matrix.outputs.matrix }} steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} - name: Get Recipes id: test-matrix run: echo "matrix=$(find ${{ inputs.group_dir }} -type f -name 'tests.yaml' -exec dirname {} \; | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT @@ -181,6 +196,8 @@ jobs: with: egress-policy: audit - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} - uses: docker/login-action@v3 with: registry: ${{ secrets.REGISTRY }} diff --git a/.github/workflows/dependency-review.yaml b/.github/workflows/dependency-review.yaml index b5c15d4b..c8db227d 100644 --- a/.github/workflows/dependency-review.yaml +++ b/.github/workflows/dependency-review.yaml @@ -25,14 +25,14 @@ on: [pull_request] permissions: contents: read concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} jobs: dependency-review: runs-on: ubuntu-latest permissions: pull-requests: write steps: - - uses: actions/checkout@v4 - - uses: actions/dependency-review-action@v4 - with: - comment-summary-in-pr: true + - uses: actions/checkout@v4 + - uses: actions/dependency-review-action@v4 + with: + comment-summary-in-pr: true diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/dockerhub-description.yml index 10ac0a19..f2849b6b 100644 --- a/.github/workflows/dockerhub-description.yml +++ b/.github/workflows/dockerhub-description.yml @@ -15,7 +15,7 @@ name: Docker Description Publish on: push: - branches: [ "main" ] + branches: ["main"] permissions: read-all jobs: setup-matrix: @@ -23,10 +23,10 @@ jobs: outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - - uses: actions/checkout@v4 - - name: Set matrix data - id: set-matrix - run: echo "matrix=$(jq -c . < .github/dockerhub-readmes.json)" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4 + - name: Set matrix data + id: set-matrix + run: echo "matrix=$(jq -c . < .github/dockerhub-readmes.json)" >> $GITHUB_OUTPUT publish-dockerhub-description: runs-on: ubuntu-latest needs: setup-matrix @@ -34,10 +34,10 @@ jobs: matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} fail-fast: false steps: - - uses: actions/checkout@v4 - - uses: peter-evans/dockerhub-description@v4 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: ${{ matrix.readmes.repo-name }} - readme-filepath: ${{ matrix.readmes.fname }} + - uses: actions/checkout@v4 + - uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: ${{ matrix.readmes.repo-name }} + readme-filepath: ${{ matrix.readmes.fname }} diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index f1a207e4..e927369d 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -21,7 +21,7 @@ on: - main permissions: read-all concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: mkdocs: @@ -31,17 +31,17 @@ jobs: id-token: write pages: write steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.8 - cache: pip - - name: Install python requirements - run: python -m pip install -r docs/requirements.txt - - name: Build - run: mkdocs build --clean - - uses: actions/upload-pages-artifact@v3 - with: - path: site - - if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) - uses: actions/deploy-pages@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.8 + cache: pip + - name: Install python requirements + run: python -m pip install -r docs/requirements.txt + - name: Build + run: mkdocs build --clean + - uses: actions/upload-pages-artifact@v3 + with: + path: site + - if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/gitleaks.yaml b/.github/workflows/gitleaks.yaml index 947408a2..c9fa7f7d 100644 --- a/.github/workflows/gitleaks.yaml +++ b/.github/workflows/gitleaks.yaml @@ -16,8 +16,10 @@ name: gitleaks on: push: branches: - - main - pull_request: null + - main + pull_request_target: + types: [opened, edited, reopened, synchronize] + branches: [main] workflow_dispatch: null permissions: read-all jobs: @@ -25,10 +27,11 @@ jobs: name: gitleaks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: gitleaks/gitleaks-action@v2 - env: - GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} - GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}} + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ 'refs/pull/${{ github.event.number }}/merge' || 'main' }} + - uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} + GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}} diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 325d7006..134a6bf5 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -12,14 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. ---- name: Integration Tests on: merge_group: null - pull_request: null + pull_request_target: + types: [opened, edited, reopened, synchronize] + branches: [main] permissions: read-all concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: group-diff: @@ -27,34 +28,34 @@ jobs: outputs: groups: ${{ steps.group-list.outputs.FOLDERS }} steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Output Modified Group Directories - id: group-list - run: | - # Get diff array filtered by specific filetypes - DIFF=$(git diff --diff-filter=d \ - --name-only ${{ github.event.merge_group.base_sha || github.event.pull_request.base.sha }}...${{ github.event.merge_group.head_sha || github.event.pull_request.head.sha }} \ - -- '*/*Dockerfile' '*.py' '*.yaml' '*.yml' '*.sh' '*/*requirements.txt' '*.json' | \ - jq -R '.' | jq -sc '.' \ - ) - # Search for compose files in each file to determine the container groups - DOCKER_COMPOSE_PATHS=() - for path in $(echo $DIFF | jq -r '.[]'); do - while [[ "$path" != "." ]]; do - DIR_PATH=$(dirname "$path") - if [ -n "$(find "$DIR_PATH" -name 'docker-compose.yaml' -print -quit)" ] && [ "$DIR_PATH" != "." ]; then - DOCKER_COMPOSE_PATHS+=("$DIR_PATH") - path="." - else - path="$DIR_PATH" - fi - done + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Output Modified Group Directories + id: group-list + run: | + # Get diff array filtered by specific filetypes + DIFF=$(git diff --diff-filter=d \ + --name-only ${{ github.event.merge_group.base_sha || github.event.pull_request.base.sha }}...${{ github.event.merge_group.head_sha || github.event.pull_request.head.sha }} \ + -- '*/*Dockerfile' '*.py' '*.yaml' '*.yml' '*.sh' '*/*requirements.txt' '*.json' | \ + jq -R '.' | jq -sc '.' \ + ) + # Search for compose files in each file to determine the container groups + DOCKER_COMPOSE_PATHS=() + for path in $(echo $DIFF | jq -r '.[]'); do + while [[ "$path" != "." ]]; do + DIR_PATH=$(dirname "$path") + if [ -n "$(find "$DIR_PATH" -name 'docker-compose.yaml' -print -quit)" ] && [ "$DIR_PATH" != "." ]; then + DOCKER_COMPOSE_PATHS+=("$DIR_PATH") + path="." + else + path="$DIR_PATH" + fi done - # Convert the array to a JSON array - DOCKER_COMPOSE_PATHS_JSON=$(printf '%s\n' "${DOCKER_COMPOSE_PATHS[@]}" | jq -R '.' | jq -sc 'unique_by(.)') - echo "FOLDERS=$DOCKER_COMPOSE_PATHS_JSON" >> $GITHUB_OUTPUT + done + # Convert the array to a JSON array + DOCKER_COMPOSE_PATHS_JSON=$(printf '%s\n' "${DOCKER_COMPOSE_PATHS[@]}" | jq -R '.' | jq -sc 'unique_by(.)') + echo "FOLDERS=$DOCKER_COMPOSE_PATHS_JSON" >> $GITHUB_OUTPUT pipeline-ci: needs: group-diff if: needs.group-diff.outputs.groups != '[""]' @@ -66,17 +67,18 @@ jobs: uses: ./.github/workflows/container-ci.yaml with: group_dir: ${{ matrix.group }} + ref: "refs/pull/${{ github.event.number }}/merge" secrets: inherit status-check: - needs: [ group-diff, pipeline-ci ] + needs: [group-diff, pipeline-ci] runs-on: ubuntu-latest if: always() steps: - - run: exit 1 - if: >- - ${{ - contains(needs.*.result, 'failure') - || contains(needs.*.result, 'cancelled') - || contains(needs.*.result, 'skipped') - && needs.group-diff.outputs.groups != '[""]' - }} + - run: exit 1 + if: >- + ${{ + contains(needs.*.result, 'failure') + || contains(needs.*.result, 'cancelled') + || contains(needs.*.result, 'skipped') + && needs.group-diff.outputs.groups != '[""]' + }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 42765f25..fdf4e5dd 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,37 +12,38 @@ # See the License for the specific language governing permissions and # limitations under the License. ---- name: Lint permissions: read-all on: merge_group: null - pull_request: null + pull_request_target: + types: [opened, edited, reopened, synchronize] + branches: [main] push: branches: - - develop - - main + - main concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: lint: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: super-linter/super-linter/slim@v6.5.1 - env: - # To report GitHub Actions status checks - GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} - GITHUB_ACTIONS_COMMAND_ARGS: '-ignore SC.*' - VALIDATE_BASH_EXEC: false - VALIDATE_CHECKOV: false - VALIDATE_HTML: false - VALIDATE_KUBERNETES_KUBECONFORM: false - VALIDATE_NATURAL_LANGUAGE: false - VALIDATE_PYTHON_FLAKE8: false - VALIDATE_PYTHON_MYPY: false - VALIDATE_PYTHON_RUFF: false + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ 'refs/pull/${{ github.event.number }}/merge' || 'main' }} + - uses: super-linter/super-linter/slim@v6.5.1 + env: + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} + GITHUB_ACTIONS_COMMAND_ARGS: '-ignore SC.*' + VALIDATE_BASH_EXEC: false + VALIDATE_CHECKOV: false + VALIDATE_HTML: false + VALIDATE_KUBERNETES_KUBECONFORM: false + VALIDATE_NATURAL_LANGUAGE: false + VALIDATE_PYTHON_FLAKE8: false + VALIDATE_PYTHON_MYPY: false + VALIDATE_PYTHON_RUFF: false diff --git a/.github/workflows/scorecard.yaml b/.github/workflows/scorecard.yaml index b56ec2ec..240202a4 100644 --- a/.github/workflows/scorecard.yaml +++ b/.github/workflows/scorecard.yaml @@ -20,9 +20,9 @@ name: Scorecard supply-chain security on: branch_protection_rule: schedule: - - cron: '0 6 * * 0' + - cron: '0 6 * * 0' push: - branches: [ "main" ] + branches: ["main"] workflow_dispatch: permissions: read-all jobs: @@ -35,20 +35,20 @@ jobs: contents: read actions: read steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - uses: ossf/scorecard-action@v2.3.3 - with: - results_file: results.sarif - results_format: sarif - repo_token: ${{ secrets.ACTION_TOKEN }} - publish_results: true - - uses: actions/upload-artifact@v4 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - uses: github/codeql-action/upload-sarif@v3.25.3 - with: - sarif_file: results.sarif + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: ossf/scorecard-action@v2.3.3 + with: + results_file: results.sarif + results_format: sarif + repo_token: ${{ secrets.ACTION_TOKEN }} + publish_results: true + - uses: actions/upload-artifact@v4 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + - uses: github/codeql-action/upload-sarif@v3.25.3 + with: + sarif_file: results.sarif diff --git a/.github/workflows/test-runner-ci.yaml b/.github/workflows/test-runner-ci.yaml index 6704f126..3755e261 100644 --- a/.github/workflows/test-runner-ci.yaml +++ b/.github/workflows/test-runner-ci.yaml @@ -15,7 +15,9 @@ name: Test Runner CI on: merge_group: null - pull_request: + pull_request_target: + types: [opened, edited, reopened, synchronize] + branches: [main] paths: - 'test-runner/**' push: @@ -23,7 +25,7 @@ on: - main permissions: read-all concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: unit-test: @@ -34,6 +36,8 @@ jobs: fail-fast: true steps: - uses: actions/checkout@v4 + with: + ref: ${{ 'refs/pull/${{ github.event.number }}/merge' || 'main' }} - uses: docker/setup-buildx-action@v3 with: driver: docker @@ -63,6 +67,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ 'refs/pull/${{ github.event.number }}/merge' || 'main' }} - uses: actions/setup-python@v5 with: python-version: "3.10" @@ -91,6 +97,8 @@ jobs: runs-on: k8-runners steps: - uses: actions/checkout@v4 + with: + ref: ${{ 'refs/pull/${{ github.event.number }}/merge' || 'main' }} - uses: docker/setup-buildx-action@v3 with: driver: docker diff --git a/.github/workflows/weekly-test.yaml b/.github/workflows/weekly-test.yaml index eb1d966c..c704e1e3 100644 --- a/.github/workflows/weekly-test.yaml +++ b/.github/workflows/weekly-test.yaml @@ -15,7 +15,7 @@ name: Weekly Tests on: schedule: - - cron: "0 0 * * 0" + - cron: "0 0 * * 0" workflow_dispatch: null permissions: read-all jobs: @@ -24,18 +24,18 @@ jobs: outputs: groups: ${{ steps.group-list.outputs.FOLDERS }} steps: - - uses: actions/checkout@v4 - - name: Output Group Directories - id: group-list - run: | - DOCKER_COMPOSE_PATHS=() - for path in $(find . -name 'docker-compose.yaml'); do - DIR_PATH=$(dirname "$path") - DOCKER_COMPOSE_PATHS+=("${DIR_PATH:2}") - done - # Convert the array to a JSON array - DOCKER_COMPOSE_PATHS_JSON=$(printf '%s\n' "${DOCKER_COMPOSE_PATHS[@]}" | uniq | jq -R '.' | jq -sc '.') - echo "FOLDERS=$DOCKER_COMPOSE_PATHS_JSON" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4 + - name: Output Group Directories + id: group-list + run: | + DOCKER_COMPOSE_PATHS=() + for path in $(find . -name 'docker-compose.yaml'); do + DIR_PATH=$(dirname "$path") + DOCKER_COMPOSE_PATHS+=("${DIR_PATH:2}") + done + # Convert the array to a JSON array + DOCKER_COMPOSE_PATHS_JSON=$(printf '%s\n' "${DOCKER_COMPOSE_PATHS[@]}" | uniq | jq -R '.' | jq -sc '.') + echo "FOLDERS=$DOCKER_COMPOSE_PATHS_JSON" >> $GITHUB_OUTPUT pipeline-ci: needs: [get-groups] strategy: @@ -46,4 +46,5 @@ jobs: uses: ./.github/workflows/container-ci.yaml with: group_dir: ${{ matrix.group }} + ref: main secrets: inherit From dfb1f810a83057ae3db2354366cf07676115ec43 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 08:18:48 -0700 Subject: [PATCH 21/40] prepare for move to prt --- .github/workflows/chart-ci.yaml | 52 ++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 0e759d36..52f43c1b 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -15,6 +15,9 @@ name: Helm Chart CI on: pull_request: null + # pull_request_target: + # types: [opened, edited, reopened, synchronize] + # branches: [main] merge_group: null permissions: read-all concurrency: @@ -24,27 +27,28 @@ jobs: helm-ci: runs-on: kubectl steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: azure/setup-kubectl@v4 - - uses: azure/setup-helm@v4.2.0 - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - name: Setup chart-testing - uses: helm/chart-testing-action@v2.6.1 - - name: Get chart diff - id: changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml) - if [[ -n "$changed" ]]; then - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - name: Helm Lint, Install, and Test - if: steps.changed.outputs.changed == 'true' - run: | - kubectl config use-context kubeflow - ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci - env: - KUBECONFIG: ${{ secrets.KUBECONFIG_PATH }} + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + # ref: ${{ 'refs/pull/${{ github.event.number }}/merge' || 'main' }} + - uses: azure/setup-kubectl@v4 + - uses: azure/setup-helm@v4.2.0 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Setup chart-testing + uses: helm/chart-testing-action@v2.6.1 + - name: Get chart diff + id: changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: Helm Lint, Install, and Test + if: steps.changed.outputs.changed == 'true' + run: | + kubectl config use-context kubeflow + ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci + env: + KUBECONFIG: ${{ secrets.KUBECONFIG_PATH }} From 565d87f1eb4c102763ed5b2635462117af2115d8 Mon Sep 17 00:00:00 2001 From: Tyler Titsworth Date: Thu, 30 May 2024 08:43:47 -0700 Subject: [PATCH 22/40] Update README.md Signed-off-by: Tyler Titsworth --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 66e5a46a..e45a9711 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@ [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/intel/ai-containers/badge)](https://securityscorecards.dev/viewer/?uri=github.com/intel/ai-containers) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fintel%2Fai-containers.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fintel%2Fai-containers?ref=badge_shield&issueType=license) [![CodeQL](https://github.com/intel/ai-containers/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/github-code-scanning/codeql) -[![Test Runner CI](https://github.com/intel/ai-containers/actions/workflows/test-runner-ci.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/test-runner-ci.yaml) -[![Weekly Tests](https://github.com/intel/ai-containers/actions/workflows/weekly-test.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/weekly-test.yaml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/intel/ai-containers/main.svg)](https://results.pre-commit.ci/latest/github/intel/ai-containers/main) [![coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/tylertitsworth/48dea0fc9a908a6e5ba5c5e84123bc02/raw/coverage.json)](https://gist.github.com/tylertitsworth/48dea0fc9a908a6e5ba5c5e84123bc02) +[![Test Runner CI](https://github.com/intel/ai-containers/actions/workflows/test-runner-ci.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/test-runner-ci.yaml) +[![Weekly Tests](https://github.com/intel/ai-containers/actions/workflows/weekly-test.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/weekly-test.yaml) +[![Helm Chart CI](https://github.com/intel/ai-containers/actions/workflows/chart-ci.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/chart-ci.yaml) This repository contains Dockerfiles, scripts, yaml files, Helm charts, etc. used to scale out AI containers with versions of TensorFlow and PyTorch that have been optimized for Intel platforms. Scaling is done with python, Docker, kubernetes, kubeflow, cnvrg.io, Helm, and other container orchestration frameworks for use in the cloud and on-premise. From 013fb600171fc4646ecb8fc2f6b0bd9e065c0acf Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 09:38:11 -0700 Subject: [PATCH 23/40] switch to prt --- .github/workflows/chart-ci.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index d98a6bc8..041ba025 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -14,10 +14,11 @@ name: Helm Chart CI on: - pull_request: null - # pull_request_target: - # types: [opened, edited, reopened, synchronize] - # branches: [main] + pull_request_target: + types: [opened, edited, reopened, synchronize] + branches: [main] + paths: + - 'workflows/charts/**' merge_group: null permissions: read-all concurrency: @@ -30,7 +31,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - # ref: ${{ github.event.pull_request.head.ref || github.ref }} + ref: ${{ github.event.pull_request.head.ref || github.ref }} - uses: azure/setup-kubectl@v4 - uses: azure/setup-helm@v4.2.0 - uses: actions/setup-python@v5 From 2fb72ca7af951447639feee226953b04b1450a96 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:05:17 -0700 Subject: [PATCH 24/40] update linter --- .github/linters/.yaml-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml index 16898da4..c085be25 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.github/linters/.yaml-lint.yml @@ -13,4 +13,4 @@ # limitations under the License. --- -ignore: 'workflows/charts/' +ignore: 'workflows/charts/**' From 0d94f599e5d050fba1836866263cf37a710cb1d4 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:11:26 -0700 Subject: [PATCH 25/40] update --- .github/linters/.yaml-lint.yml | 4 +++- workflows/charts/test/README.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 workflows/charts/test/README.md diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml index c085be25..5aaad730 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.github/linters/.yaml-lint.yml @@ -13,4 +13,6 @@ # limitations under the License. --- -ignore: 'workflows/charts/**' +extends: default +ignore: | + 'workflows/charts/' diff --git a/workflows/charts/test/README.md b/workflows/charts/test/README.md new file mode 100644 index 00000000..989ae5fe --- /dev/null +++ b/workflows/charts/test/README.md @@ -0,0 +1,30 @@ +# chart-test + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) + +A Helm chart for Kubernetes + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| tylertitsworth | | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"nginx"` | | +| image.tag | string | `""` | | +| nameOverride | string | `""` | | +| replicaCount | int | `1` | | +| service.port | int | `80` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) From 197b1c6d83fe2b4119b0ec65593eb0efbc20cbc1 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:13:42 -0700 Subject: [PATCH 26/40] update confrigs --- .github/workflows/chart-ci.yaml | 1 + .pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 041ba025..fd41de1d 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -14,6 +14,7 @@ name: Helm Chart CI on: + pull_request: null pull_request_target: types: [opened, edited, reopened, synchronize] branches: [main] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c40df2e..eb9f3852 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: autofix_prs: true autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" autoupdate_schedule: "weekly" - skip: [pylint, shellcheck, markdownlint, hadolint-docker, shfmt, tox, mkdocs, ct] + skip: [pylint, shellcheck, markdownlint, hadolint-docker, helm-docs-container, shfmt, tox, mkdocs, ct] repos: - hooks: - id: check-added-large-files From e053cfc318a83a0229e2f4d657d5b23e532ed34c Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:21:12 -0700 Subject: [PATCH 27/40] update lint config --- .github/linters/.yaml-lint.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml index 5aaad730..5ecdccbc 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.github/linters/.yaml-lint.yml @@ -15,4 +15,11 @@ --- extends: default ignore: | + '.github/' + 'enterprise/' 'workflows/charts/' +rules: + max: 80 + level: warning + indentation: + indent-sequences: whatever From 0c68cd4653e593228bbb6b0e0ff9ee1dacf9a572 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:24:24 -0700 Subject: [PATCH 28/40] print contexts --- .github/workflows/chart-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index fd41de1d..313b8441 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -50,6 +50,7 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | + kubectl config get-contexts kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: From 4d8bc3bc75ae73e0084fa14c080e25b1a06f8328 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:26:56 -0700 Subject: [PATCH 29/40] sleep test --- .github/workflows/chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 313b8441..c3c79fd3 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -50,7 +50,7 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | - kubectl config get-contexts + sleep 720 kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: From 0feca6fb8186c9ccf686677993da00758635c169 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:36:08 -0700 Subject: [PATCH 30/40] remove sleep --- .github/workflows/chart-ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index c3c79fd3..fd41de1d 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -50,7 +50,6 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | - sleep 720 kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: From d5851cf46be84e458f42302ce0301c6b1827720d Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:38:11 -0700 Subject: [PATCH 31/40] correct invalid yaml config --- .github/linters/.yaml-lint.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml index 5ecdccbc..b32684aa 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.github/linters/.yaml-lint.yml @@ -19,7 +19,8 @@ ignore: | 'enterprise/' 'workflows/charts/' rules: - max: 80 - level: warning + line-length: + max: 80 + level: warning indentation: indent-sequences: whatever From 71f6823e7ff7bb6ff7230436c588e7418d9e9d9a Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 10:43:25 -0700 Subject: [PATCH 32/40] cp config --- .github/workflows/chart-ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index fd41de1d..20deff93 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -50,7 +50,8 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | + cp -r ${{ secrets.KUBECONFIG_PATH }} /tmp/config.yaml kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: - KUBECONFIG: ${{ secrets.KUBECONFIG_PATH }} + KUBECONFIG: /tmp/config.yaml From 8006070c8b99f216378759498b3e4812f28cac6f Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 11:29:36 -0700 Subject: [PATCH 33/40] update config --- .github/linters/.yaml-lint.yml | 7 ++-- pytorch/serving/tests.yaml | 33 ++++++++-------- pytorch/tests/tests.yaml | 71 +++++++++++++++++----------------- 3 files changed, 54 insertions(+), 57 deletions(-) diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml index b32684aa..c1a74a25 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.github/linters/.yaml-lint.yml @@ -16,11 +16,10 @@ extends: default ignore: | '.github/' - 'enterprise/' - 'workflows/charts/' + '**/templates/*.yaml' rules: + indentation: + indent-sequences: whatever line-length: max: 80 level: warning - indentation: - indent-sequences: whatever diff --git a/pytorch/serving/tests.yaml b/pytorch/serving/tests.yaml index a6a0b9e0..ae8e92e4 100644 --- a/pytorch/serving/tests.yaml +++ b/pytorch/serving/tests.yaml @@ -12,16 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. ---- ipex-serving-model-archive: img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-py${PYTHON_VERSION:-3.10}-torchserve cmd: /home/model-server/model-archive/mar-test.sh entrypoint: /bin/bash volumes: - - src: $PWD/pytorch/serving/model-archive - dst: /home/model-server/model-archive - - src: $PWD/pytorch/serving/model-store - dst: /home/model-server/model-store + - src: $PWD/pytorch/serving/model-archive + dst: /home/model-server/model-archive + - src: $PWD/pytorch/serving/model-store + dst: /home/model-server/model-store user: root workdir: /home/model-server/model-archive ipex-serving-workflow-archive: @@ -29,10 +28,10 @@ ipex-serving-workflow-archive: cmd: /home/model-server/model-archive/war-test.sh entrypoint: /bin/bash volumes: - - src: $PWD/pytorch/serving/model-archive - dst: /home/model-server/model-archive - - src: $PWD/pytorch/serving/wf-store - dst: /home/model-server/wf-store + - src: $PWD/pytorch/serving/model-archive + dst: /home/model-server/model-archive + - src: $PWD/pytorch/serving/wf-store + dst: /home/model-server/wf-store user: root workdir: /home/model-server/model-archive ipex-serving-rest-workflow: @@ -40,10 +39,10 @@ ipex-serving-rest-workflow: cmd: bash /home/model-server/wf-store/rest-test.sh serving: True volumes: - - src: $PWD/pytorch/serving/model-store - dst: /home/model-server/model-store - - src: $PWD/pytorch/serving/wf-store - dst: /home/model-server/wf-store + - src: $PWD/pytorch/serving/model-store + dst: /home/model-server/model-store + - src: $PWD/pytorch/serving/wf-store + dst: /home/model-server/wf-store env: ENABLE_TORCH_PROFILER: 'true' shm_size: 1g @@ -53,8 +52,8 @@ ipex-serving-rest-inference: cmd: bash /home/model-server/model-store/rest-test.sh serving: True volumes: - - src: $PWD/pytorch/serving/model-store - dst: /home/model-server/model-store + - src: $PWD/pytorch/serving/model-store + dst: /home/model-server/model-store env: ENABLE_TORCH_PROFILER: 'true' shm_size: 1g @@ -64,8 +63,8 @@ ipex-serving-grpc-inference: cmd: bash /home/model-server/model-store/grpc-test.sh serving: True volumes: - - src: $PWD/pytorch/serving/model-store - dst: /home/model-server/model-store + - src: $PWD/pytorch/serving/model-store + dst: /home/model-server/model-store env: ENABLE_TORCH_PROFILER: 'true' shm_size: 1g diff --git a/pytorch/tests/tests.yaml b/pytorch/tests/tests.yaml index 35de7150..4d26c25e 100644 --- a/pytorch/tests/tests.yaml +++ b/pytorch/tests/tests.yaml @@ -12,50 +12,49 @@ # See the License for the specific language governing permissions and # limitations under the License. ---- import-ipex-cpu-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-base - cmd: python -c "import torch;import intel_extension_for_pytorch as ipex;print(f'torch {torch.__version__} ipex {ipex.__version__}')" + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-base + cmd: python -c "import torch;import intel_extension_for_pytorch as ipex;print(f'torch {torch.__version__} ipex {ipex.__version__}')" import-ipex-xpu-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.20xpu}-xpu-base - cmd: python -c "import torch; import intel_extension_for_pytorch as ipex;[print(f'[{i}] {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];" + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.20xpu}-xpu-base + cmd: python -c "import torch; import intel_extension_for_pytorch as ipex;[print(f'[{i}] {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];" import-cpu-jupyter-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-jupyter - cmd: python -m jupyter --version + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-jupyter + cmd: python -m jupyter --version import-xpu-jupyter-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.20xpu}-xpu-jupyter - cmd: python -m jupyter --version + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.20xpu}-xpu-jupyter + cmd: python -m jupyter --version import-cpu-oneccl-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-oneccl-inc-${INC_VERSION:-2.5.1} - cmd: python -c "import oneccl_bindings_for_pytorch as oneccl; print(f'oneccl {oneccl.__version__}')" + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-oneccl-inc-${INC_VERSION:-2.5.1} + cmd: python -c "import oneccl_bindings_for_pytorch as oneccl; print(f'oneccl {oneccl.__version__}')" import-cpu-inc-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-oneccl-inc-${INC_VERSION:-2.5.1} - cmd: python -c "import neural_compressor as inc;print(inc.__version__)" + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-oneccl-inc-${INC_VERSION:-2.5.1} + cmd: python -c "import neural_compressor as inc;print(inc.__version__)" ipex-cpu-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-base - cmd: python /tests/ipex-resnet50.py --ipex --device cpu --backend gloo - volumes: - - dst: /tests - src: $PWD/pytorch/tests + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-base + cmd: python /tests/ipex-resnet50.py --ipex --device cpu --backend gloo + volumes: + - dst: /tests + src: $PWD/pytorch/tests ipex-xpu-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.20xpu}-xpu-base - cmd: python /tests/ipex-resnet50.py --ipex --device xpu - volumes: - - dst: /tests - src: $PWD/pytorch/tests + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.20xpu}-xpu-base + cmd: python /tests/ipex-resnet50.py --ipex --device xpu + volumes: + - dst: /tests + src: $PWD/pytorch/tests ipex-xpu-jupyter-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/aiops/mlops-ci:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.20xpu}-xpu-jupyter - cmd: papermill --log-output /jupyter/xpu.ipynb -k python3 - notebook: True + img: ${REGISTRY}/aiops/mlops-ci:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.20xpu}-xpu-jupyter + cmd: papermill --log-output /jupyter/xpu.ipynb -k python3 + notebook: True oneccl-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-oneccl-inc-${INC_VERSION:-2.5.1} - cmd: ipexrun cpu /tests/ipex-resnet50.py --ipex --device cpu --backend ccl - volumes: - - dst: /tests - src: $PWD/pytorch/tests + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-oneccl-inc-${INC_VERSION:-2.5.1} + cmd: ipexrun cpu /tests/ipex-resnet50.py --ipex --device cpu --backend ccl + volumes: + - dst: /tests + src: $PWD/pytorch/tests inc-${PACKAGE_OPTION:-pip}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-oneccl-inc-${INC_VERSION:-2.5.1} - cmd: python /tests/inc-quant.py - volumes: - - dst: /tests - src: $PWD/pytorch/tests + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.3.0}-oneccl-inc-${INC_VERSION:-2.5.1} + cmd: python /tests/inc-quant.py + volumes: + - dst: /tests + src: $PWD/pytorch/tests From 6585f4dfa18f4c754088691a0b842a7545d6df02 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 13:06:27 -0700 Subject: [PATCH 34/40] update ignore --- .github/linters/.yaml-lint.yml | 2 +- python/tests/tests.yaml | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml index c1a74a25..52a5bc0b 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.github/linters/.yaml-lint.yml @@ -16,7 +16,7 @@ extends: default ignore: | '.github/' - '**/templates/*.yaml' + 'workflows/charts/*/templates/' rules: indentation: indent-sequences: whatever diff --git a/python/tests/tests.yaml b/python/tests/tests.yaml index 8bdbf297..5e82b365 100644 --- a/python/tests/tests.yaml +++ b/python/tests/tests.yaml @@ -13,20 +13,20 @@ # limitations under the License. import-${IDP_VERISON:-core}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-idp-${IDP_VERSION:-core}-py${PYTHON_VERSION:-3.10}-base - cmd: python -c "import mkl" + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-idp-${IDP_VERSION:-core}-py${PYTHON_VERSION:-3.10}-base + cmd: python -c "import mkl" perf-${IDP_VERSION:-core}: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-idp-${IDP_VERSION:-core}-py${PYTHON_VERSION:-3.10}-base - cmd: python /tests/perf_sample.py - volumes: - - dst: /tests - src: $PWD/python/tests + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-idp-${IDP_VERSION:-core}-py${PYTHON_VERSION:-3.10}-base + cmd: python /tests/perf_sample.py + volumes: + - dst: /tests + src: $PWD/python/tests perf-stock: - img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-pip-py${PYTHON_VERSION:-3.10}-base - cmd: python /tests/perf_sample.py - volumes: - - dst: /tests - src: $PWD/python/tests + img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-pip-py${PYTHON_VERSION:-3.10}-base + cmd: python /tests/perf_sample.py + volumes: + - dst: /tests + src: $PWD/python/tests # compare-perf-${IDP_VERSION:-core}: # img: python:3.11-slim-bullseye # cmd: bash /tests/compare-perf.sh ${IDP_VERSION:-core} From d6c1c2dfef14be2d50411222e65f87980a9050ce Mon Sep 17 00:00:00 2001 From: Tyler Titsworth Date: Thu, 30 May 2024 16:04:23 -0700 Subject: [PATCH 35/40] Update dependabot.yml Signed-off-by: Tyler Titsworth --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ca5a99f7..2a17ce7a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -77,6 +77,8 @@ updates: patterns: - "*" package-ecosystem: pip + schedule: + interval: weekly - package-ecosystem: docker directory: /classical-ml schedule: From c2a5497067474e21dba581066e326a33e6188159 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 16:16:08 -0700 Subject: [PATCH 36/40] update lint config and workflows --- .github/linters/.yaml-lint.yml | 11 +---------- .github/workflows/chart-ci.yaml | 6 +++--- .github/workflows/scorecard.yaml | 1 - .github/workflows/weekly-test.yaml | 1 - .../charts/test/templates/tests/test-connection.yaml | 1 + 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml index 52a5bc0b..6c2a65c3 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.github/linters/.yaml-lint.yml @@ -13,13 +13,4 @@ # limitations under the License. --- -extends: default -ignore: | - '.github/' - 'workflows/charts/*/templates/' -rules: - indentation: - indent-sequences: whatever - line-length: - max: 80 - level: warning +ignore: '**/templates/**.yaml' diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index a87f3237..0105ae1a 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -14,6 +14,7 @@ name: Helm Chart CI on: + pull_request: null pull_request_target: types: [opened, edited, reopened, synchronize] branches: [main] @@ -32,7 +33,6 @@ jobs: uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0 with: egress-policy: audit - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 @@ -54,8 +54,8 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | - cp -r ${{ secrets.KUBECONFIG_PATH }} /tmp/config.yaml + install -m 0600 ${{ secrets.KUBECONFIG_PATH }} /k8s/config.yaml kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: - KUBECONFIG: /tmp/config.yaml + KUBECONFIG: /k8s/config.yaml diff --git a/.github/workflows/scorecard.yaml b/.github/workflows/scorecard.yaml index 364fbe1c..f8505959 100644 --- a/.github/workflows/scorecard.yaml +++ b/.github/workflows/scorecard.yaml @@ -39,7 +39,6 @@ jobs: uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0 with: egress-policy: audit - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: persist-credentials: false diff --git a/.github/workflows/weekly-test.yaml b/.github/workflows/weekly-test.yaml index 5315bcdc..d39bd70e 100644 --- a/.github/workflows/weekly-test.yaml +++ b/.github/workflows/weekly-test.yaml @@ -28,7 +28,6 @@ jobs: uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0 with: egress-policy: audit - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Output Group Directories id: group-list diff --git a/workflows/charts/test/templates/tests/test-connection.yaml b/workflows/charts/test/templates/tests/test-connection.yaml index da0991b5..eb4466f3 100644 --- a/workflows/charts/test/templates/tests/test-connection.yaml +++ b/workflows/charts/test/templates/tests/test-connection.yaml @@ -1,3 +1,4 @@ +# yamllint disable-file # Copyright (c) 2024 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); From 8d3ec880e20dfc87d4be5e99406b7f80035396e8 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 16:31:11 -0700 Subject: [PATCH 37/40] update perms --- .github/workflows/chart-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 0105ae1a..78d0b975 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -54,6 +54,7 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | + mkdir -m 0644 /k8s install -m 0600 ${{ secrets.KUBECONFIG_PATH }} /k8s/config.yaml kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci From bf07dc027e06374b1012ca58668c7bc3be5b0a23 Mon Sep 17 00:00:00 2001 From: tylertitsworth Date: Thu, 30 May 2024 17:25:29 -0700 Subject: [PATCH 38/40] move dir --- .github/workflows/chart-ci.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 78d0b975..e4bb2342 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -54,9 +54,8 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | - mkdir -m 0644 /k8s - install -m 0600 ${{ secrets.KUBECONFIG_PATH }} /k8s/config.yaml + sudo install -m 0600 ${{ secrets.KUBECONFIG_PATH }} /tmp/config.yaml kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: - KUBECONFIG: /k8s/config.yaml + KUBECONFIG: /tmp/config.yaml From 63a6430a483492113eca4d15e4b10525bf9c5a4a Mon Sep 17 00:00:00 2001 From: Tyler Titsworth Date: Thu, 30 May 2024 18:16:32 -0700 Subject: [PATCH 39/40] Update chart-ci.yaml --- .github/workflows/chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index e4bb2342..374d4c2e 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -54,7 +54,7 @@ jobs: - name: Helm Lint, Install, and Test if: steps.changed.outputs.changed == 'true' run: | - sudo install -m 0600 ${{ secrets.KUBECONFIG_PATH }} /tmp/config.yaml + install -m 0600 ${{ secrets.KUBECONFIG_PATH }} /tmp/config.yaml kubectl config use-context kubeflow ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --config .github/ct.yaml --debug --namespace helm-ci env: From 2d7d0d006ea00b0c76af746cd150ebf788eb32cd Mon Sep 17 00:00:00 2001 From: Tyler Titsworth Date: Thu, 30 May 2024 18:19:37 -0700 Subject: [PATCH 40/40] Update chart-ci.yaml --- .github/workflows/chart-ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/chart-ci.yaml b/.github/workflows/chart-ci.yaml index 374d4c2e..a00cfff8 100644 --- a/.github/workflows/chart-ci.yaml +++ b/.github/workflows/chart-ci.yaml @@ -14,7 +14,6 @@ name: Helm Chart CI on: - pull_request: null pull_request_target: types: [opened, edited, reopened, synchronize] branches: [main]