Skip to content

Commit

Permalink
Merge pull request #7774 from madhavajay/madhava/helm_chart
Browse files Browse the repository at this point in the history
Added syft.build.helm and syft.test.helm tasks to tox
  • Loading branch information
madhavajay authored Jun 19, 2023
2 parents 0a06494 + 165f464 commit b89bbb3
Show file tree
Hide file tree
Showing 14 changed files with 1,461 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
exclude: ^(packages/grid/backend/wheels/.*|docs/img/header.png|docs/img/terminalizer.gif)
- id: check-yaml
always_run: true
exclude: ^(packages/grid/k8s/rendered/)
exclude: ^(packages/grid/k8s/rendered/|packages/grid/helm/)
- id: check-merge-conflict
always_run: true
args: ["--assume-in-merge"]
Expand Down
40 changes: 28 additions & 12 deletions packages/grid/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ pipelines:
# You can run this pipeline via `devspace deploy` (or `devspace run-pipeline deploy`)
deploy:
run: |-
run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
ensure_pull_secrets --all # 2. Ensure pull secrets
build_images --all -t $(git rev-parse --short=6 HEAD) # 3. Build, tag (git commit hash) and push all images (see "images")
create_deployments --all # 4. Deploy Helm charts and manifests specfied as "deployments"
run_dependencies --all
ensure_pull_secrets --all
build_images --all -t $(git rev-parse --short=6 HEAD) -t 0.8.1-beta.11 -t dev-latest
create_deployments --all
vars:
DEVSPACE_ENV_FILE: "default.env"
CONTAINER_REGISTRY: "docker.io/"
VERSION: "0.8.1-beta.11"

# This is a list of `images` that DevSpace can build for this project
# We recommend to skip image building during development (devspace dev) as much as possible
Expand All @@ -31,25 +33,25 @@ images:
context: ../
tags:
- dev-latest
- 0.8.1-beta.11
- "${VERSION}"
tailscale:
image: "${CONTAINER_REGISTRY}${DOCKER_IMAGE_TAILSCALE}"
buildKit: {}
dockerfile: ./vpn/tailscale.dockerfile
context: ./vpn
tags:
- dev-latest
- 0.8.1-beta.11
- "${VERSION}"
frontend:
image: ${CONTAINER_REGISTRY}${DOCKER_IMAGE_FRONTEND}
image: "${CONTAINER_REGISTRY}${DOCKER_IMAGE_FRONTEND}"
buildKit:
args: ["--target", "grid-ui-production"]
dockerfile: ./frontend/frontend.dockerfile
target: "grid-ui-production"
context: ./frontend
tags:
- dev-latest
- 0.8.1-beta.11
- "${VERSION}"

# This is a list of `deployments` that DevSpace can create for this project
deployments:
Expand All @@ -65,9 +67,12 @@ deployments:

proxy:
helm:
upgradeArgs:
- --dependency-update
chart:
name: component-chart
repo: https://charts.devspace.sh
version: "0.9.0"
values:
containers:
- image: "${DOCKER_IMAGE_TRAEFIK}:${TRAEFIK_VERSION}"
Expand All @@ -78,7 +83,7 @@ deployments:
env:
- name: SERVICE_NAME
value: "proxy"
- image: "${CONTAINER_REGISTRY}${DOCKER_IMAGE_TAILSCALE}"
- image: "${CONTAINER_REGISTRY}${DOCKER_IMAGE_TAILSCALE}:${VERSION}"
securityContext:
capabilities:
add: ["NET_ADMIN", "SYS_MODULE"]
Expand Down Expand Up @@ -110,12 +115,15 @@ deployments:

backend:
helm:
upgradeArgs:
- --dependency-update
chart:
name: component-chart
repo: https://charts.devspace.sh
version: "0.9.0"
values:
containers:
- image: "${CONTAINER_REGISTRY}${DOCKER_IMAGE_BACKEND}"
- image: "${CONTAINER_REGISTRY}${DOCKER_IMAGE_BACKEND}:${VERSION}"
volumeMounts:
- containerPath: /storage
volume:
Expand Down Expand Up @@ -182,9 +190,12 @@ deployments:
- port: "${HTTP_PORT}"
mongo:
helm:
upgradeArgs:
- --dependency-update
chart:
name: component-chart
repo: https://charts.devspace.sh
version: "0.9.0"
values:
containers:
- image: mongo:latest
Expand All @@ -203,16 +214,21 @@ deployments:
- name: mongo-data
size: "5Gi"
service:
name: mongo
ports:
- port: "27017"

frontend:
helm:
upgradeArgs:
- --dependency-update
chart:
name: component-chart
repo: https://charts.devspace.sh
version: "0.9.0"
values:
containers:
- image: "${CONTAINER_REGISTRY}${DOCKER_IMAGE_FRONTEND}"
- image: "${CONTAINER_REGISTRY}${DOCKER_IMAGE_FRONTEND}:${VERSION}"
env:
- name: VERSION
value: "${VERSION}"
Expand All @@ -225,7 +241,7 @@ deployments:
service:
name: "frontend"
ports:
- port: 80
- port: "80"

dev:
mongo:
Expand Down
19 changes: 19 additions & 0 deletions packages/grid/helm/component-chart/templates/backend-headless.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Service
metadata:
annotations:
helm.sh/chart: component-chart-0.8.6
labels:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: backend
name: backend-headless
spec:
clusterIP: None
ports:
- name: web
port: 80
selector:
app.kubernetes.io/component: backend
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: devspace-app
148 changes: 148 additions & 0 deletions packages/grid/helm/component-chart/templates/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
---
apiVersion: v1
kind: Service
metadata:
annotations:
helm.sh/chart: component-chart-0.8.6
labels:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: backend
name: backend
spec:
externalIPs: null
ports:
- name: port-0
port: 80
protocol: TCP
targetPort: 80
selector:
app.kubernetes.io/component: backend
app.kubernetes.io/name: devspace-app
type: ClusterIP
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
helm.sh/chart: component-chart-0.8.6
labels:
app.kubernetes.io/component: backend
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: devspace-app
name: backend
spec:
podManagementPolicy: OrderedReady
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: backend
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: devspace-app
serviceName: backend-headless
template:
metadata:
annotations:
helm.sh/chart: component-chart-0.8.6
labels:
app.kubernetes.io/component: backend
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: devspace-app
spec:
affinity: null
containers:
- args: null
command: null
env:
- name: MONGO_PORT
value: "27017"
- name: MONGO_HOST
value: mongo
- name: MONGO_USERNAME
value: root
- name: MONGO_PASSWORD
value: example
- name: SERVICE_NAME
value: backend
- name: RELEASE
value: production
- name: VERSION
value: 0.8.1-beta.11
- name: VERSION_HASH
value: unknown
- name: NODE_TYPE
value: domain
- name: NODE_NAME
value: default_node_name
- name: STACK_API_KEY
value: changeme
- name: PORT
value: "80"
- name: IGNORE_TLS_ERRORS
value: "False"
- name: HTTP_PORT
value: "80"
- name: HTTPS_PORT
value: "443"
- name: CONTAINER_HOST
value: k8s
- name: TRACE
value: "False"
- name: JAEGER_HOST
value: localhost
- name: JAEGER_PORT
value: "14268"
- name: DEV_MODE
value: "False"
- name: DOMAIN_CONNECTION_PORT
value: "3030"
- name: ENABLE_OBLV
value: "false"
- name: DEFAULT_ROOT_EMAIL
value: [email protected]
- name: DEFAULT_ROOT_PASSWORD
value: changethis
- name: BACKEND_STORAGE_PATH
value: /storage
envFrom: null
image: docker.io/openmined/grid-backend:0.8.1-beta.11
lifecycle: null
livenessProbe: null
name: container-0
readinessProbe: null
securityContext: null
startupProbe: null
volumeDevices: null
volumeMounts:
- mountPath: /storage
name: credentials-data
readOnly: false
subPath: credentials-data
dnsConfig: null
ephemeralContainers: null
hostAliases: null
imagePullSecrets: null
initContainers: null
nodeName: null
nodeSelector: null
overhead: null
readinessGates: null
securityContext: null
terminationGracePeriodSeconds: 5
tolerations: null
topologySpreadConstraints: null
volumes: null
volumeClaimTemplates:
- metadata:
annotations:
helm.sh/chart: component-chart-0.8.6
labels:
app.kubernetes.io/component: backend
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: devspace-app
name: credentials-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
87 changes: 87 additions & 0 deletions packages/grid/helm/component-chart/templates/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
apiVersion: v1
kind: Service
metadata:
annotations:
helm.sh/chart: component-chart-0.8.6
labels:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: frontend
name: frontend
spec:
externalIPs: null
ports:
- name: port-0
port: 80
protocol: TCP
targetPort: 80
selector:
app.kubernetes.io/component: frontend
app.kubernetes.io/name: devspace-app
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
helm.sh/chart: component-chart-0.8.6
labels:
app.kubernetes.io/component: frontend
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: devspace-app
name: frontend
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: frontend
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: devspace-app
strategy:
type: Recreate
template:
metadata:
annotations:
helm.sh/chart: component-chart-0.8.6
labels:
app.kubernetes.io/component: frontend
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: devspace-app
spec:
affinity: null
containers:
- args: null
command: null
env:
- name: VERSION
value: 0.8.1-beta.11
- name: VERSION_HASH
value: unknown
- name: NODE_TYPE
value: domain
- name: NEXT_PUBLIC_API_URL
value: ${NEXT_PUBLIC_API_URL}
envFrom: null
image: docker.io/openmined/grid-frontend:0.8.1-beta.11
lifecycle: null
livenessProbe: null
name: container-0
readinessProbe: null
securityContext: null
startupProbe: null
volumeDevices: null
volumeMounts: null
dnsConfig: null
ephemeralContainers: null
hostAliases: null
imagePullSecrets: null
initContainers: null
nodeName: null
nodeSelector: null
overhead: null
readinessGates: null
securityContext: null
terminationGracePeriodSeconds: 5
tolerations: null
topologySpreadConstraints: null
volumes: null
Loading

0 comments on commit b89bbb3

Please sign in to comment.