Skip to content

Commit dfa205f

Browse files
committed
feat(frontend): Switch to upstream frontend v1.3.0
Signed-off-by: sylus <[email protected]>
1 parent cd1e003 commit dfa205f

File tree

462 files changed

+32257
-15915
lines changed

Some content is hidden

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

462 files changed

+32257
-15915
lines changed

Diff for: .github/workflows/build.yml

+47-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,58 @@
1-
name: build
2-
on: [pull_request]
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
37

48
env:
9+
K3D_VERSION: 4.4.7
10+
KUBECTL_VERSION: 1.21.2
11+
KUSTOMIZE_VERSION: 4.1.3
512
REGISTRY_NAME: k8scc01covidacr
613

714
jobs:
8-
build:
15+
test:
16+
name: 'Test'
917
runs-on: ubuntu-latest
18+
1019
steps:
11-
- uses: actions/checkout@master
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Gather dependencies
24+
run: |
25+
mkdir -p ${GITHUB_WORKSPACE}/bin/
26+
27+
# install kubectl
28+
curl -L https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o ${GITHUB_WORKSPACE}/bin/kubectl && chmod +x ${GITHUB_WORKSPACE}/bin/kubectl
29+
30+
# install kustomize
31+
curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz -o kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && tar -zxvf kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && chmod +x kustomize && mv kustomize ${GITHUB_WORKSPACE}/bin/kustomize
32+
33+
# install k3d
34+
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v${K3D_VERSION} bash
35+
36+
# install taskfile
37+
curl -sL https://taskfile.dev/install.sh | sh
38+
39+
# install yq
40+
sudo snap install yq
41+
42+
- name: GitHub Path
43+
run: |
44+
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
45+
46+
- name: Build Binary
47+
run: |
48+
task go:build
49+
50+
- name: Linting
51+
run: |
52+
task go:vet
1253
13-
- run: |
54+
- name: Build Container
55+
run: |
1456
docker build -f Dockerfile -t ${{ env.REGISTRY_NAME }}.azurecr.io/jupyter-apis:${{ github.sha }} .
1557
1658
- uses: Azure/container-scan@v0

Diff for: .github/workflows/test.yml

-54
This file was deleted.

Diff for: Dockerfile

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Stage 0: UI Build Stage
22
FROM node:12-buster-slim as frontend
33
WORKDIR /src
4-
COPY ./jupyter/frontend/package*.json ./
5-
COPY ./jupyter/frontend/tsconfig*.json ./
6-
COPY ./jupyter/frontend/angular.json ./
7-
COPY ./jupyter/frontend/src ./src
84
ENV NG_CLI_ANALYTICS "ci"
5+
COPY ./frontend/common/kubeflow-common-lib/package*.json ./
96
RUN npm ci
10-
COPY --from=frontend-kubeflow-lib /src/dist/kubeflow/ ./node_modules/kubeflow/
7+
COPY ./frontend/common/kubeflow-common-lib/ .
8+
RUN npm run build
9+
COPY ./frontend/jupyter/package*.json ./
10+
COPY ./frontend/jupyter/tsconfig*.json ./
11+
COPY ./frontend/jupyter/angular.json ./
12+
COPY ./frontend/jupyter/src ./src
13+
RUN npm ci
14+
RUN cp -R /src/dist/kubeflow/ ./node_modules/kubeflow/
1115
RUN npm run build -- --output-path=./dist/default --configuration=production
1216
RUN npm run build -- --output-path=./dist/rok --configuration=rok-prod
1317

@@ -21,9 +25,9 @@ RUN go mod download
2125
COPY . .
2226
RUN CGO_ENABLED=0 go install .
2327

24-
# Generate final image
28+
# Stage 2: Generate final image
2529
FROM scratch
26-
COPY --from=frontend /app/dist/out/default /static/
30+
COPY --from=frontend /src/dist/default /static/
2731
COPY --from=backend /go/bin/jupyter-apis /jupyter-apis
2832
ENV LISTEN_ADDRESS 0.0.0.0:5000
2933
EXPOSE 5000

Diff for: Taskfile.yml

+18
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ vars:
1212

1313
CLUSTER_NAME: jupyter-apis
1414
CONTEXT_NAME: "k3d-{{.CLUSTER_NAME}}"
15+
CONTAINER_IMAGE_NAME: jupyter-apis
16+
CONTAINER_IMAGE_TAG: {sh: git rev-parse HEAD}
17+
CONTAINER_IMAGE: "{{.CONTAINER_IMAGE_NAME}}:{{.CONTAINER_IMAGE_TAG}}"
1518
KUBECTL: "kubectl --context={{.CONTEXT_NAME}}"
1619
KUBEAPPLY: "{{.KUBECTL}} apply"
1720
KUSTOMIZE: "{{.KUBEAPPLY}} --kustomize"
@@ -59,6 +62,21 @@ tasks:
5962
deps:
6063
- task: go:format
6164

65+
docker:build:
66+
desc: Build the container image
67+
cmds:
68+
- docker build -t {{.CONTAINER_IMAGE}} -f Dockerfile .
69+
70+
docker:enter:
71+
desc: Enter into the built container
72+
cmds:
73+
- docker run -it --rm --entrypoint=sh {{.CONTAINER_IMAGE}}
74+
75+
docker:push:
76+
desc: Push the built container image
77+
cmds:
78+
- docker push {{.CONTAINER_IMAGE}}
79+
6280
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go-task/Taskfile.yml
6381
go:build:
6482
desc: Build the Go code

Diff for: frontend/LICENSE

-202
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)