Skip to content

Commit 76e7415

Browse files
mathis-marcotteWendy V GaultierBryan Pagetrohank07Mathis Marcotte
authored
Upgrade Jupyter apis to v1.6.0 (#132)
* feat(frontend): upgrade frontend to 1.6 bringing in customizations * feat(translations): for 1.6, PRs (#166), (#183) * fix(angular translations): (#161) * feat(folder structure): changed folder structure to match 1.6 * chore(unwanted code): commented out unwanted features, removed dead code * feat(hint text): added back * feat(tables): add volume table (#145), add kubecost table (#149) * feat(sas): add SAS functionality back (#147) * fix(various): image pull policy fix (#151), validation (#144), volumes (#164) * fix(system language, limits): added back system language input (#150), modify limits (#152) * feat(Taskfile.yaml): update go:build task * fix(sc): added missing api endpoint for storage classes * refactor(Dockerfile): bind API to new port, change copy paths * fix(frontend): icon paths, svg paths, env path to logo svgs and added * fix(backend):update to handle new frontend structure * fix(failing build): (#169) * fix(volume name): update formCtrl.get() (#174) * feat(pro-b):added Pro b icon to notebook and volume table (#179) * fix(default language):language context set to system language input (#180) Co-authored-by: Wendy V Gaultier <[email protected]> Co-authored-by: Bryan Paget <[email protected]> Co-authored-by: Rohan Katkar <[email protected]> Co-authored-by: Mathis Marcotte <[email protected]> Co-authored-by: Jose Manuel (Ito) <[email protected]> Co-authored-by: Wendy Gaultier <[email protected]> Co-authored-by: Jose-Matsuda <[email protected]> Co-authored-by: Collin Brown <[email protected]> Co-authored-by: Collin Brown <[email protected]> Co-authored-by: Bryan Paget <[email protected]>
1 parent 9fcef88 commit 76e7415

File tree

327 files changed

+78207
-19987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+78207
-19987
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
coverage_unit.txt
22
jupyter-apis
3+
crud-web-apps
4+
.task/
35
.vscode
46
.env
57
.task
6-
__debug_bin
8+
__debug_bin

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ COPY ./frontend/jupyter/package*.json ./
1111
COPY ./frontend/jupyter/tsconfig*.json ./
1212
COPY ./frontend/jupyter/angular.json ./
1313
COPY ./frontend/jupyter/src ./src
14+
COPY ./frontend/jupyter/i18n /src/i18n
15+
1416
RUN npm ci
17+
1518
RUN cp -R /src/dist/kubeflow/ ./node_modules/kubeflow/
1619
RUN npm run build -- --output-path=./dist/default --configuration=production
1720
RUN npm run build -- --output-path=./dist/rok --configuration=rok-prod
21+
# Build both locales:
22+
RUN ./node_modules/.bin/ng build --configuration production --localize
1823

1924
# Stage 1: Build with the golang image
2025
FROM golang:1.17-alpine AS backend
@@ -27,9 +32,12 @@ COPY . .
2732
RUN CGO_ENABLED=0 go install .
2833

2934
# Stage 2: Generate final image
30-
FROM scratch
31-
COPY --from=frontend /src/dist/default /static/
35+
FROM alpine:3.16.2
36+
COPY --from=frontend /src/dist/frontend /src/dist/frontend
37+
COPY --from=frontend /src/dist/default /src/dist/default
3238
COPY --from=backend /go/bin/jupyter-apis /jupyter-apis
33-
ENV LISTEN_ADDRESS 0.0.0.0:5000
34-
EXPOSE 5000
39+
ENV LISTEN_ADDRESS 0.0.0.0:5001
40+
EXPOSE 5001
3541
ENTRYPOINT [ "/jupyter-apis" ]
42+
43+
# TODO Will need to mount the static logo files too

Taskfile.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ tasks:
6565
desc: Build the container image
6666
cmds:
6767
- docker build -t {{.CONTAINER_IMAGE}} -f Dockerfile .
68+
- "k3d image import {{.CONTAINER_IMAGE}} -c nginx-test"
6869

6970
docker:enter:
7071
desc: Enter into the built container

TaskfileLocalDebug.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
version: "3"
2+
dotenv: [".env"]
3+
output: prefixed
4+
silent: true
5+
6+
vars:
7+
CLUSTER_NAME: nginx-test
8+
CONTEXT_NAME: "k3d-{{.CLUSTER_NAME}}"
9+
AGENT_NODE_NAME: k3d-{{.CLUSTER_NAME}}-agent
10+
SERVER_NODE_NAME: k3d-{{.CLUSTER_NAME}}-server
11+
ISTIO_VERSION: "1.7.8" # Match istio control plane version
12+
ISTIOCTL: "istioctl --context={{.CONTEXT_NAME}}"
13+
KUBECTL: "kubectl --context={{.CONTEXT_NAME}}"
14+
REGISTRY_NAME: "{{.CLUSTER_NAME}}-registry"
15+
REGISTRY_PORT: "5050"
16+
DEV_CONTAINER_TAG: "{{.CLUSTER_NAME}}-dev"
17+
18+
tasks:
19+
# _ _____ _
20+
# | | _|___ / __| |
21+
# | |/ / |_ \ / _` |
22+
# | < ___) | (_| |
23+
# |_|\_\____/ \__,_|
24+
25+
k3d:cluster:create:
26+
prefix: ⚙️ > create k3d cluster
27+
desc: create k3d cluster
28+
cmds:
29+
- k3d cluster create --config=k8s/k3d/config.yaml
30+
31+
k3d:cluster:destroy:
32+
prefix: ⚙️ > destroy
33+
desc: destroy k3d cluster
34+
cmds:
35+
- "k3d cluster delete {{.CLUSTER_NAME}}"
36+
37+
k3d:start:
38+
prefix: ⚙️ > start
39+
desc: starts k3d cluster
40+
cmds:
41+
- "k3d cluster start {{.CLUSTER_NAME}}"
42+
43+
k3d:stop:
44+
prefix: ⚙️ > stop
45+
desc: stops k3d cluster
46+
cmds:
47+
- "k3d cluster stop {{.CLUSTER_NAME}}"
48+
49+
# K8s manifest
50+
k8s:manifest:apply:
51+
prefix: ⚙️ > k8sapply
52+
desc: Apply manifest to k3d cluster
53+
cmds:
54+
- "kustomize build k8s/manifests/ | kubectl apply -f -"
55+
sources:
56+
- k8s/manifests/*.yaml
57+
58+
# _ _
59+
# __| | ___ ___| | _____ _ __
60+
# / _` |/ _ \ / __| |/ / _ \ '__|
61+
# | (_| | (_) | (__| < __/ |
62+
# \__,_|\___/ \___|_|\_\___|_|
63+
# k3d image import nginx-test-dev:latest -c nginx-test
64+
build:dev-image:
65+
prefix: build dev image
66+
desc: build development image
67+
cmds:
68+
- "docker build . -t {{.DEV_CONTAINER_TAG}}"
69+
- "k3d image import {{.DEV_CONTAINER_TAG}}:latest -c {{.CLUSTER_NAME}}"
70+
sources:
71+
- Dockerfile
72+
# ____ ___ ______ ____
73+
# / ___|_ _| / / ___| _ \
74+
# | | | | / / | | | | |
75+
# | |___ | | / /| |___| |_| |
76+
# \____|___/_/ \____|____/
77+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go-task/Taskfile.yml
78+
go:build:
79+
desc: Build the Go code
80+
cmds:
81+
- go build -v {{.LDFLAGS}}
82+

config.go

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,34 @@ type DataVolumes struct {
6060
}
6161

6262
type ValueElement struct {
63-
Value ValueValue `yaml:"value" json:"value"`
63+
Value VolumeValues `yaml:"value" json:"value"`
6464
}
6565

66-
type ValueValue struct {
67-
Type ImagePullPolicy `yaml:"type" json:"type"`
68-
Name ImagePullPolicy `yaml:"name" json:"name"`
69-
Size ImagePullPolicy `yaml:"size" json:"size"`
70-
MountPath ImagePullPolicy `yaml:"mountPath" json:"mountPath"`
71-
AccessModes ImagePullPolicy `yaml:"accessModes" json:"accessModes"`
72-
Class ImagePullPolicy `yaml:"class" json:"class"`
66+
// Structs for the yaml versions of definitions, minimalistic as it is just a default
67+
//can't re-use structs from go since this is yaml and not json
68+
type VolumeValues struct {
69+
Mount string `yaml:"mount" json:"mount"`
70+
NewPvc NewPvcYaml `yaml:"newPvc" json:"newPvc"`
7371
}
7472

73+
type NewPvcMetadataYaml struct {
74+
Name string `yaml:"name" json:"name"`
75+
}
76+
type NewPvcRequestsYaml struct {
77+
Storage string `yaml:"storage" json:"storage"`
78+
}
79+
type NewPvcResourcesYaml struct {
80+
Requests NewPvcRequestsYaml `yaml:"requests" json:"requests"`
81+
}
82+
type NewPvcSpecYaml struct {
83+
Resources NewPvcResourcesYaml `yaml:"resources" json:"resources"`
84+
AccessModes []corev1.PersistentVolumeAccessMode `yaml:"accessModes" json:"accessModes"`
85+
}
86+
type NewPvcYaml struct {
87+
Metadata NewPvcMetadataYaml `yaml:"metadata" json:"metadata"`
88+
Spec NewPvcSpecYaml `yaml:"spec" json:"spec"`
89+
} // last struct for yaml versions
90+
7591
type ImagePullPolicy struct {
7692
Value string `yaml:"value" json:"value"`
7793
}
@@ -129,8 +145,8 @@ type TolerationGroupOption struct {
129145
}
130146

131147
type WorkspaceVolume struct {
132-
Value ValueValue `yaml:"value" json:"value"`
133-
ReadOnly bool `yaml:"readOnly" json:"readOnly"`
148+
Value VolumeValues `yaml:"value" json:"value"`
149+
ReadOnly bool `yaml:"readOnly" json:"readOnly"`
134150
}
135151

136152
type Configuration struct {

frontend/common/kubeflow-common-lib/angular.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@
1010
"prefix": "lib",
1111
"architect": {
1212
"build": {
13-
"builder": "@angular-devkit/build-ng-packagr:build",
13+
"builder": "@angular-devkit/build-angular:ng-packagr",
1414
"options": {
1515
"tsConfig": "projects/kubeflow/tsconfig.lib.json",
1616
"project": "projects/kubeflow/ng-package.json"
1717
}
18-
},
18+
, "configurations": {
19+
"production": {
20+
"tsConfig": "projects/kubeflow/tsconfig.lib.prod.json"
21+
}
22+
}
23+
},
1924
"test": {
2025
"builder": "@angular-devkit/build-angular:karma",
2126
"options": {
@@ -39,4 +44,4 @@
3944
}
4045
}},
4146
"defaultProject": "kubeflow"
42-
}
47+
}

0 commit comments

Comments
 (0)