Skip to content

Commit e588954

Browse files
committed
Add new env variable support for github
1 parent 9249901 commit e588954

5 files changed

Lines changed: 96 additions & 24 deletions

File tree

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ ADD launch.sh /
2626

2727
ENV GIT_REPO https://github.com/satyamz/ml-playground.git
2828

29-
3029
EXPOSE 8888
3130

3231
ENTRYPOINT [ "/usr/bin/tini", "--" ]

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,19 @@ docker pull satyamz/docker-jupyter:v0.4
1616
```
1717
docker run -e GIT_REPO=github/repo/url/to/notebooks.git -p 8888:8888 satyamz/docker-jupyter:v0.4
1818
```
19+
20+
### Optional environment variables required
21+
22+
```
23+
# Github handle
24+
GITHUB_USERNAME
25+
26+
# User name to set in git config
27+
USER_NAME
28+
29+
# User email address
30+
USER_EMAIL
31+
32+
#Github personal access token
33+
GITHUB_TOKEN
34+
```

k8s/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@ $ vagrant ssh kubemaster-01
1919

2020
Once logged in to kubemaster-01
2121

22+
#### Set following environment variable in openebs-ds.yaml
23+
24+
25+
```
26+
# Github handle
27+
GITHUB_USERNAME
28+
29+
# User name to set in git config
30+
USER_NAME
31+
32+
# User email address
33+
USER_EMAIL
34+
35+
#Github personal access token
36+
GITHUB_TOKEN
37+
```
38+
39+
40+
2241
### Create pods
2342

2443
```

k8s/openebs-ds.yaml

Lines changed: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,63 @@
1+
apiVersion: apps/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: jupyter-server
5+
namespace: default
6+
spec:
7+
replicas: 1
8+
template:
9+
metadata:
10+
labels:
11+
name: jupyter-server
12+
spec:
13+
containers:
14+
- name: jupyter-server
15+
imagePullPolicy: Always
16+
image: satyamz/docker-jupyter:v0.4
17+
ports:
18+
- containerPort: 8888
19+
env:
20+
- name: GIT_REPO
21+
value: https://github.com/vharsh/plot-demo.git
22+
- name: GITHUB_USERNAME
23+
value: "your-username"
24+
- name: USER_NAME
25+
value: "Your Name"
26+
- name: USER_EMAIL
27+
value: "you@mail.com"
28+
- name: GITHUB_TOKEN
29+
value: "GithubPersonalAccessToken"
30+
volumeMounts:
31+
- name: data-vol
32+
mountPath: /mnt/data
33+
volumes:
34+
- name: data-vol
35+
persistentVolumeClaim:
36+
claimName: jupyter-data-vol-claim
37+
---
38+
kind: PersistentVolumeClaim
39+
apiVersion: v1
40+
metadata:
41+
name: jupyter-data-vol-claim
42+
spec:
43+
storageClassName: openebs-jupyter
44+
accessModes:
45+
- ReadWriteOnce
46+
resources:
47+
requests:
48+
storage: 5G
49+
---
150
apiVersion: v1
2-
kind: Pod
51+
kind: Service
352
metadata:
4-
name: openebs-ds-pod
5-
53+
name: jupyter-service
654
spec:
7-
hostNetwork: true
8-
9-
containers:
10-
- image: satyamz/docker-jupyter:v0.4
11-
name: docker-jupyter
12-
env:
13-
- name: GIT_REPO
14-
value: https://github.com/vharsh/plot-demo.git
15-
ports:
16-
- containerPort: 8888
17-
hostPort: 8888
18-
volumeMounts:
19-
- name: shared-data
20-
mountPath: /mnt/data
21-
22-
volumes:
23-
- name: shared-data
24-
hostPath:
25-
path: /data
55+
ports:
56+
- name: ui
57+
port: 8888
58+
nodePort: 32424
59+
protocol: TCP
60+
selector:
61+
name: jupyter-server
62+
sessionAffinity: None
63+
type: NodePort

launch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
echo "Fetching notebooks from" $GIT_REPO
3+
echo "Fetching notebooks from" $GIT_REPO
44

55
git clone $GIT_REPO /home/notebooks
66

0 commit comments

Comments
 (0)