Skip to content

Commit

Permalink
Upgrade Jupyter apis to v1.6.0 (#132)
Browse files Browse the repository at this point in the history
* 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 <wendyvgaultier@gmail.com>
Co-authored-by: Bryan Paget <bryan.paget@statcan.gc.ca>
Co-authored-by: Rohan Katkar <rohank_17@hotmail.ca>
Co-authored-by: Mathis Marcotte <mathis.marcotte@statcan.gc.ca>
Co-authored-by: Jose Manuel (Ito) <jose.matsuda@statcan.gc.ca>
Co-authored-by: Wendy Gaultier <wendy.gaultier2@canada.ca>
Co-authored-by: Jose-Matsuda <jose.matsuda@canada.ca>
Co-authored-by: Collin Brown <collin.j.brown95@gmail.com>
Co-authored-by: Collin Brown <Collinbrown95@gmail.com>
Co-authored-by: Bryan Paget <bbrryyaann@protonmail.com>
  • Loading branch information
11 people authored Nov 3, 2022
1 parent 9fcef88 commit 76e7415
Show file tree
Hide file tree
Showing 327 changed files with 78,207 additions and 19,987 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
coverage_unit.txt
jupyter-apis
crud-web-apps
.task/
.vscode
.env
.task
__debug_bin
__debug_bin
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ COPY ./frontend/jupyter/package*.json ./
COPY ./frontend/jupyter/tsconfig*.json ./
COPY ./frontend/jupyter/angular.json ./
COPY ./frontend/jupyter/src ./src
COPY ./frontend/jupyter/i18n /src/i18n

RUN npm ci

RUN cp -R /src/dist/kubeflow/ ./node_modules/kubeflow/
RUN npm run build -- --output-path=./dist/default --configuration=production
RUN npm run build -- --output-path=./dist/rok --configuration=rok-prod
# Build both locales:
RUN ./node_modules/.bin/ng build --configuration production --localize

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

# Stage 2: Generate final image
FROM scratch
COPY --from=frontend /src/dist/default /static/
FROM alpine:3.16.2
COPY --from=frontend /src/dist/frontend /src/dist/frontend
COPY --from=frontend /src/dist/default /src/dist/default
COPY --from=backend /go/bin/jupyter-apis /jupyter-apis
ENV LISTEN_ADDRESS 0.0.0.0:5000
EXPOSE 5000
ENV LISTEN_ADDRESS 0.0.0.0:5001
EXPOSE 5001
ENTRYPOINT [ "/jupyter-apis" ]

# TODO Will need to mount the static logo files too
1 change: 1 addition & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ tasks:
desc: Build the container image
cmds:
- docker build -t {{.CONTAINER_IMAGE}} -f Dockerfile .
- "k3d image import {{.CONTAINER_IMAGE}} -c nginx-test"

docker:enter:
desc: Enter into the built container
Expand Down
82 changes: 82 additions & 0 deletions TaskfileLocalDebug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
version: "3"
dotenv: [".env"]
output: prefixed
silent: true

vars:
CLUSTER_NAME: nginx-test
CONTEXT_NAME: "k3d-{{.CLUSTER_NAME}}"
AGENT_NODE_NAME: k3d-{{.CLUSTER_NAME}}-agent
SERVER_NODE_NAME: k3d-{{.CLUSTER_NAME}}-server
ISTIO_VERSION: "1.7.8" # Match istio control plane version
ISTIOCTL: "istioctl --context={{.CONTEXT_NAME}}"
KUBECTL: "kubectl --context={{.CONTEXT_NAME}}"
REGISTRY_NAME: "{{.CLUSTER_NAME}}-registry"
REGISTRY_PORT: "5050"
DEV_CONTAINER_TAG: "{{.CLUSTER_NAME}}-dev"

tasks:
# _ _____ _
# | | _|___ / __| |
# | |/ / |_ \ / _` |
# | < ___) | (_| |
# |_|\_\____/ \__,_|

k3d:cluster:create:
prefix: ⚙️ > create k3d cluster
desc: create k3d cluster
cmds:
- k3d cluster create --config=k8s/k3d/config.yaml

k3d:cluster:destroy:
prefix: ⚙️ > destroy
desc: destroy k3d cluster
cmds:
- "k3d cluster delete {{.CLUSTER_NAME}}"

k3d:start:
prefix: ⚙️ > start
desc: starts k3d cluster
cmds:
- "k3d cluster start {{.CLUSTER_NAME}}"

k3d:stop:
prefix: ⚙️ > stop
desc: stops k3d cluster
cmds:
- "k3d cluster stop {{.CLUSTER_NAME}}"

# K8s manifest
k8s:manifest:apply:
prefix: ⚙️ > k8sapply
desc: Apply manifest to k3d cluster
cmds:
- "kustomize build k8s/manifests/ | kubectl apply -f -"
sources:
- k8s/manifests/*.yaml

# _ _
# __| | ___ ___| | _____ _ __
# / _` |/ _ \ / __| |/ / _ \ '__|
# | (_| | (_) | (__| < __/ |
# \__,_|\___/ \___|_|\_\___|_|
# k3d image import nginx-test-dev:latest -c nginx-test
build:dev-image:
prefix: build dev image
desc: build development image
cmds:
- "docker build . -t {{.DEV_CONTAINER_TAG}}"
- "k3d image import {{.DEV_CONTAINER_TAG}}:latest -c {{.CLUSTER_NAME}}"
sources:
- Dockerfile
# ____ ___ ______ ____
# / ___|_ _| / / ___| _ \
# | | | | / / | | | | |
# | |___ | | / /| |___| |_| |
# \____|___/_/ \____|____/
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go-task/Taskfile.yml
go:build:
desc: Build the Go code
cmds:
- go build -v {{.LDFLAGS}}

36 changes: 26 additions & 10 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,34 @@ type DataVolumes struct {
}

type ValueElement struct {
Value ValueValue `yaml:"value" json:"value"`
Value VolumeValues `yaml:"value" json:"value"`
}

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

type NewPvcMetadataYaml struct {
Name string `yaml:"name" json:"name"`
}
type NewPvcRequestsYaml struct {
Storage string `yaml:"storage" json:"storage"`
}
type NewPvcResourcesYaml struct {
Requests NewPvcRequestsYaml `yaml:"requests" json:"requests"`
}
type NewPvcSpecYaml struct {
Resources NewPvcResourcesYaml `yaml:"resources" json:"resources"`
AccessModes []corev1.PersistentVolumeAccessMode `yaml:"accessModes" json:"accessModes"`
}
type NewPvcYaml struct {
Metadata NewPvcMetadataYaml `yaml:"metadata" json:"metadata"`
Spec NewPvcSpecYaml `yaml:"spec" json:"spec"`
} // last struct for yaml versions

type ImagePullPolicy struct {
Value string `yaml:"value" json:"value"`
}
Expand Down Expand Up @@ -129,8 +145,8 @@ type TolerationGroupOption struct {
}

type WorkspaceVolume struct {
Value ValueValue `yaml:"value" json:"value"`
ReadOnly bool `yaml:"readOnly" json:"readOnly"`
Value VolumeValues `yaml:"value" json:"value"`
ReadOnly bool `yaml:"readOnly" json:"readOnly"`
}

type Configuration struct {
Expand Down
11 changes: 8 additions & 3 deletions frontend/common/kubeflow-common-lib/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/kubeflow/tsconfig.lib.json",
"project": "projects/kubeflow/ng-package.json"
}
},
, "configurations": {
"production": {
"tsConfig": "projects/kubeflow/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand All @@ -39,4 +44,4 @@
}
}},
"defaultProject": "kubeflow"
}
}
Loading

0 comments on commit 76e7415

Please sign in to comment.