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

Support syncing PySpark applications from Git #372

Open
1 task
sbernauer opened this issue Mar 8, 2024 · 1 comment
Open
1 task

Support syncing PySpark applications from Git #372

sbernauer opened this issue Mar 8, 2024 · 1 comment

Comments

@sbernauer
Copy link
Member

sbernauer commented Mar 8, 2024

In case you have multiple Python files that form an application it is inconvenient to put everything in a ConfigMap.
It would be nice if you could use the same mechanism as implemented in Airflow using gitsync.

Related to stackabletech/opa-operator#504, which implements the same thing for OPA regorules.

Tasks

@iscsrwm
Copy link

iscsrwm commented May 7, 2024

As a workaround you can use an initContainer in your podOverrides.spec to sync your code. Here is an example:

driver:
podOverrides:
spec:
initContainers:
- image: k8s.gcr.io/git-sync:v3.0.1
name: git-data
volumeMounts:
- name: git-source
mountPath: /tmp/git
env:
- name: GIT_SYNC_ONE_TIME
value: "true"
- name: GIT_SYNC_REPO
value: https://gitlab.com/mycompany/myapp.git
- name: GIT_SYNC_BRANCH
value: test
- name: GIT_SYNC_DEPTH
value: "1"
- name: GIT_SYNC_DEST
value: my_app
- name: GIT_SYNC_USERNAME
valueFrom:
secretKeyRef:
name: gitpuller-creds
key: user
- name: GIT_SYNC_PASSWORD
valueFrom:
secretKeyRef:
name: gitpuller-creds
key: password
volumes:
- name: git-source
emptyDir: {}
replicas: 1
config:
resources:
cpu:
min: "1"
max: "4"
memory:
limit: "2Gi"
volumeMounts:
- name: git-source
mountPath: /common

In this example your code would be available in your driver container at /common/my_app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants