Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sysbox): onboard sysbox as a secure container runtime #788

Merged
merged 90 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
3fdca55
sysbox artifact init
rauerhans Jul 24, 2023
04c90e6
add ng
rauerhans Jul 25, 2023
775b8c9
ignore local tf files during debugging
rauerhans Jul 25, 2023
c6eb8c6
change path
rauerhans Jul 25, 2023
9fb4110
pass on launch_template var
rauerhans Jul 25, 2023
c67f795
test
rauerhans Jul 27, 2023
51deaeb
add icon
rauerhans Jul 27, 2023
dd6faae
rm ingress
rauerhans Jul 27, 2023
736d599
fix vars
rauerhans Jul 27, 2023
d1aedb0
seems to have troubles with subnets, rm for now
rauerhans Jul 27, 2023
dcf1e2e
not yet published, hardcode
rauerhans Jul 27, 2023
6bcf64c
set some required variables
rauerhans Jul 27, 2023
6d45681
add sysbox reserved taint
rauerhans Jul 28, 2023
a5b0962
add block device mappings
rauerhans Jul 28, 2023
e0ac47b
add sysbox-install label
rauerhans Jul 28, 2023
d89de48
desired capacity one
rauerhans Jul 28, 2023
fefcc7c
clean up
rauerhans Jul 28, 2023
f9e1422
sysbox resources for install
rauerhans Jul 28, 2023
a72709a
fix pluralfile
rauerhans Jul 28, 2023
86cadbc
rm gitignore, messes with tf publish
rauerhans Jul 31, 2023
b475663
format
rauerhans Jul 31, 2023
2baaa88
make recipes private
rauerhans Jul 31, 2023
d5dad66
rename ng, lt
rauerhans Jul 31, 2023
d98a8dc
string valued
rauerhans Jul 31, 2023
65fc5b3
output ngs, debug
rauerhans Jul 31, 2023
cdc966c
use subnet ids from other nodegroups
rauerhans Jul 31, 2023
6562229
paremetrize subnets correctly
rauerhans Jul 31, 2023
c4ccae1
shorten names
rauerhans Jul 31, 2023
859ac2b
disk size in lt
rauerhans Jul 31, 2023
e6902f1
mark recipes as non-private
michaeljguarino Jul 31, 2023
8081ea8
add outputs to artifact
rauerhans Aug 1, 2023
05ead60
pass key pari create flag
rauerhans Aug 1, 2023
7ff36c2
add eks label
rauerhans Aug 1, 2023
c11c75c
create key pair
rauerhans Aug 1, 2023
d4580f8
eks.amazonaws.com/ is reserved label prefix
rauerhans Aug 1, 2023
97d8e53
fix typo
rauerhans Aug 1, 2023
ec5b142
bubble up key s
rauerhans Aug 1, 2023
bd31535
fix ami
rauerhans Aug 1, 2023
ae60ae4
clean up
rauerhans Aug 3, 2023
3cfaac4
revert to tpl
rauerhans Aug 3, 2023
e4a7299
prepare usable helm chart
rauerhans Aug 3, 2023
b4ea841
prep helm chart
rauerhans Aug 3, 2023
9a0c235
mark not private
rauerhans Aug 3, 2023
8ab685a
get subnets from bootstrap artifact
rauerhans Aug 3, 2023
9acc1e7
add toleration
rauerhans Aug 3, 2023
db8651a
rm node role arn, inferred from eks data soruce
rauerhans Aug 3, 2023
8f8144e
uninstall with hook
rauerhans Aug 7, 2023
5ee28d4
fix tpl
rauerhans Aug 7, 2023
4f78a1f
add helm labels and annotations
rauerhans Aug 7, 2023
736c247
fix labels
rauerhans Aug 7, 2023
11d2fc7
change filter
rauerhans Aug 7, 2023
5f405b2
set max pods to 16
rauerhans Aug 7, 2023
7cfbbe2
pass owners
rauerhans Aug 8, 2023
e304320
restructure temporarily
rauerhans Aug 8, 2023
86dbb45
labels and taints
rauerhans Aug 8, 2023
88328d5
move into its onw
rauerhans Aug 8, 2023
7f93c76
complete yaml
rauerhans Aug 8, 2023
d17ea80
fix ami filter
rauerhans Aug 8, 2023
a97ff97
add plural ami ng
rauerhans Aug 8, 2023
15c80df
fix owners
rauerhans Aug 8, 2023
b84e246
update plural sysbox ami
rauerhans Aug 8, 2023
9507676
new ami
rauerhans Aug 9, 2023
bc84ffe
test new ami
rauerhans Aug 9, 2023
3509926
rm outputs
rauerhans Aug 9, 2023
a0e4180
test new ami, + tf
rauerhans Aug 9, 2023
68ae81a
rearrange, rm unnecessary templates
rauerhans Aug 9, 2023
3432473
new ami
rauerhans Aug 9, 2023
114dec5
use multi az
rauerhans Aug 9, 2023
81f09e9
correct labels
rauerhans Aug 9, 2023
e73ecd1
update ami
rauerhans Aug 9, 2023
d307c9e
rm old lt
rauerhans Aug 9, 2023
51bc294
rm explicit labels
rauerhans Aug 9, 2023
4514f14
rm k8s install
rauerhans Aug 9, 2023
6b4a0b5
update ami
rauerhans Aug 10, 2023
563de44
new ami
rauerhans Aug 10, 2023
4b1ecbe
clean up
rauerhans Aug 10, 2023
268bdde
fix performancetype
rauerhans Aug 10, 2023
349581b
new ami
rauerhans Aug 10, 2023
bd6ea81
test max pods
rauerhans Aug 10, 2023
33cd1c2
update final ami
rauerhans Aug 11, 2023
06903d8
update ami owner
rauerhans Aug 16, 2023
959c9c5
pass lt as var to ng
rauerhans Aug 16, 2023
77925ae
clean up
rauerhans Aug 16, 2023
5bdf67a
point to module-library release ref
rauerhans Aug 16, 2023
c675275
set app version to sysbox version
rauerhans Aug 16, 2023
f8f9284
rm sysbox ns
rauerhans Aug 16, 2023
668c6dc
rm azure and gcp artifacts
rauerhans Aug 16, 2023
e705354
rm gcp recipe
rauerhans Aug 16, 2023
f2373ae
rm deps from azure/gcp
rauerhans Aug 16, 2023
5edbb4e
bump
rauerhans Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions ray/terraform/aws/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "namespace" {
type = string
type = string
default = "ray"
}

Expand All @@ -8,7 +8,7 @@ variable "cluster_name" {
}

variable "create_single_az_node_groups" {
type = bool
type = bool
default = false
}

Expand All @@ -27,34 +27,35 @@ variable "node_groups_defaults" {
type = any
default = {
desired_capacity = 0
min_capacity = 0
max_capacity = 3
min_capacity = 0
max_capacity = 3

instance_types = ["t3.large", "t3a.large"]
disk_size = 50
ami_release_version = "1.22.15-20221222"
instance_types = ["t3.large", "t3a.large"]
disk_size = 50
ami_release_version = "1.22.15-20221222"
force_update_version = true
ami_type = "AL2_x86_64"
k8s_labels = {}
k8s_taints = []
ami_type = "AL2_x86_64"
k8s_labels = {}
k8s_taints = []
}
}

variable "single_az_node_groups" {
type = any
default = {
ray_small_burst_spot = {
name = "ray-small-burst-spot"
capacity_type = "SPOT"
name = "ray-small-burst-spot"
capacity_type = "SPOT"
instance_types = ["t3.large", "t3a.large"]
k8s_labels = {
"plural.sh/capacityType" = "SPOT"
"plural.sh/capacityType" = "SPOT"
"plural.sh/performanceType" = "BURST"
"plural.sh/scalingGroup" = "ray-small-burst-spot"
"plural.sh/scalingGroup" = "ray-small-burst-spot"
"sysbox-install" = "yes"
}
k8s_taints = [{
key = "plural.sh/capacityType"
value = "SPOT"
key = "plural.sh/capacityType"
value = "SPOT"
effect = "NO_SCHEDULE"
}]
}
Expand Down
6 changes: 6 additions & 0 deletions sysbox/Pluralfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
REPO sysbox
ATTRIBUTES nestybox repository.yaml
rauerhans marked this conversation as resolved.
Show resolved Hide resolved

TF terraform/*
HELM helm/*
RECIPE plural/recipes/*
23 changes: 23 additions & 0 deletions sysbox/helm/sysbox/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
6 changes: 6 additions & 0 deletions sysbox/helm/sysbox/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: sysbox
description: helm chart for sysbox
type: application
version: 0.1.0
appVersion: "v1.0.0"
1 change: 1 addition & 0 deletions sysbox/helm/sysbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A helm chart for sysbox
28 changes: 28 additions & 0 deletions sysbox/helm/sysbox/deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
application: true
description: Deploys sysbox crafted for the target cloud
spec:
dependencies:
- type: helm
name: bootstrap
repo: bootstrap
version: '>= 0.5.1'


- type: terraform
name: aws
repo: sysbox
version: '>= 0.1.0'
optional: true
- type: terraform
name: azure
repo: sysbox
version: '>= 0.1.0'
optional: true
- type: terraform
name: gcp
repo: sysbox
version: '>= 0.1.0'
optional: true
22 changes: 22 additions & 0 deletions sysbox/helm/sysbox/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 "sysbox.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 "sysbox.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "sysbox.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 "sysbox.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 }}
62 changes: 62 additions & 0 deletions sysbox/helm/sysbox/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "sysbox.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 "sysbox.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 "sysbox.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "sysbox.labels" -}}
helm.sh/chart: {{ include "sysbox.chart" . }}
{{ include "sysbox.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "sysbox.selectorLabels" -}}
app.kubernetes.io/name: {{ include "sysbox.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "sysbox.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "sysbox.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
61 changes: 61 additions & 0 deletions sysbox/helm/sysbox/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "sysbox.fullname" . }}
labels:
{{- include "sysbox.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "sysbox.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "sysbox.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "sysbox.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.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
28 changes: 28 additions & 0 deletions sysbox/helm/sysbox/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "sysbox.fullname" . }}
labels:
{{- include "sysbox.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "sysbox.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions sysbox/helm/sysbox/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "sysbox.fullname" . }}
labels:
{{- include "sysbox.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "sysbox.selectorLabels" . | nindent 4 }}
12 changes: 12 additions & 0 deletions sysbox/helm/sysbox/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "sysbox.serviceAccountName" . }}
labels:
{{- include "sysbox.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions sysbox/helm/sysbox/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "sysbox.fullname" . }}-test-connection"
labels:
{{- include "sysbox.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "sysbox.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
Loading