-
Notifications
You must be signed in to change notification settings - Fork 39
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
binary file via init #595
base: main
Are you sure you want to change the base?
binary file via init #595
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ jobs: | |
- services_test.py | ||
- signet_test.py | ||
- scenarios_test.py | ||
- binary_test.py | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: azure/[email protected] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v2 | ||
name: bin-runner | ||
description: A Helm chart for the bin-runner Pod | ||
version: 0.1.0 | ||
type: application |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
pod: | ||
name: bin-runner | ||
namespace: warnet | ||
|
||
podLabels: | ||
app: "warnet" | ||
mission: "binary" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Binary executing |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "binary-runner.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 "binary-runner.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "binary-runner.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "binary-runner.labels" -}} | ||
helm.sh/chart: {{ include "binary-runner.chart" . }} | ||
{{ include "binary-runner.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- with .Values.podLabels }} | ||
{{ toYaml . }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "binary-runner.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "binary-runner.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "binary-runner.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "binary-runner.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ include "binary-runner.fullname" . }} | ||
labels: | ||
{{- include "binary-runner.labels" . | nindent 4 }} | ||
app: {{ include "binary-runner.name" . }} | ||
mission: binary | ||
spec: | ||
restartPolicy: Never | ||
volumes: | ||
- name: shared-data | ||
emptyDir: {} | ||
containers: | ||
- name: {{ .Values.pod.name }}-runner | ||
image: alpine | ||
command: ["/bin/sh", "-c"] | ||
args: | ||
- | | ||
echo "Waiting for binary file..." | ||
while [ ! -f /data/binary ]; do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this wait was moved into the main container we wouldn't need the initContainer? Is there another advantage to the init container? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no other advantage, nice spot. This is just an artefact of me trying to migrate from Removed the init container in effe95d |
||
sleep 1 | ||
done | ||
echo "Binary found!" | ||
chmod +x /data/binary | ||
/data/binary | ||
exit 0 | ||
volumeMounts: | ||
- name: shared-data | ||
mountPath: /data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- --help
is specific to Commander/test framework, might not apply to all binaries