Skip to content

Properly build docker images workflow #42

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

Merged
merged 8 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable=true
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ Make sure you have the runtime containers images pulled.
- TODO use a more generic image tag here, e.g. latest

```
docker pull lihebi/codepod-kernel-python:v0.4.3-alpha.4
docker pull lihebi/codepod-runtime:v0.4.3-alpha.4
```

Or you can build the images:

```
docker build -t lihebi/codepod-kernel-python:v0.4.3-alpha.4 ./runtime/kernel
docker build -t lihebi/codepod-runtime:v0.4.3-alpha.4 ./runtime
docker pull lihebi/codepod-kernel-python
docker pull lihebi/codepod-runtime
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions compose/dev/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ services:
JWT_SECRET: ${JWT_SECRET}
KERNEL_NETWORK: "codepod"
PROXY_API_URL: "http://proxy:4011/graphql"
ZMQ_KERNEL_IMAGE: "lihebi/codepod-kernel-python:v0.4.3-alpha.4"
WS_RUNTIME_IMAGE: "lihebi/codepod-runtime:v0.4.3-alpha.4"
ZMQ_KERNEL_IMAGE: "lihebi/codepod-kernel-python:latest"
WS_RUNTIME_IMAGE: "lihebi/codepod-runtime:latest"

ui:
image: node:18
Expand Down
4 changes: 2 additions & 2 deletions compose/prod/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ services:
JWT_SECRET: ${JWT_SECRET}
KERNEL_NETWORK: "codepod"
PROXY_API_URL: "http://proxy:4011/graphql"
ZMQ_KERNEL_IMAGE: "lihebi/codepod-kernel-python:v0.4.3-alpha.4"
WS_RUNTIME_IMAGE: "lihebi/codepod-runtime:v0.4.3-alpha.4"
ZMQ_KERNEL_IMAGE: "lihebi/codepod-kernel-python:latest"
WS_RUNTIME_IMAGE: "lihebi/codepod-runtime:latest"

ui:
build: ../../ui
Expand Down
23 changes: 11 additions & 12 deletions deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
Build the docker images:

```
docker build -t lihebi/codepod-ui:v0.4.3-alpha.4 ./ui
docker build -t lihebi/codepod-api:v0.4.3-alpha.4 ./api
docker build -t lihebi/codepod-proxy:v0.4.3-alpha.4 ./proxy
docker build -t lihebi/codepod-kernel-python:v0.4.3-alpha.4 ./runtime/kernel
docker build -t lihebi/codepod-runtime:v0.4.3-alpha.4 ./runtime
docker build -t lihebi/codepod-ui:<tag> ./ui
docker build -t lihebi/codepod-api:<tag> ./api
docker build -t lihebi/codepod-proxy:<tag> ./proxy
docker build -t lihebi/codepod-kernel-python:<tag> ./runtime/kernel
docker build -t lihebi/codepod-runtime:<tag> ./runtime
```

Push to registry:

```
docker push lihebi/codepod-ui:v0.4.3-alpha.4
docker push lihebi/codepod-api:v0.4.3-alpha.4
docker push lihebi/codepod-proxy:v0.4.3-alpha.4
docker push lihebi/codepod-kernel-python:v0.4.3-alpha.4
docker push lihebi/codepod-runtime:v0.4.3-alpha.4
docker push lihebi/codepod-ui:<tag>
docker push lihebi/codepod-api:<tag>
docker push lihebi/codepod-proxy:<tag>
docker push lihebi/codepod-kernel-python:<tag>
docker push lihebi/codepod-runtime:<tag>
```

Create a cloud VM with docker support. Add DNS from domain name to the cloud
Expand Down Expand Up @@ -61,8 +61,7 @@ npx prisma migrate dev --name init
Pull the kernel image:

```
docker pull lihebi/codepod-kernel-python:v0.4.3-alpha.4
docker tag lihebi/codepod-kernel-python:v0.4.3-alpha.4 codepod-kernel-python
docker pull lihebi/codepod-kernel-python
```

Now go to
Expand Down
2 changes: 1 addition & 1 deletion k8s/helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v0.4.3-alpha.4"
appVersion: "0.4.3"
4 changes: 4 additions & 0 deletions k8s/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@ Optionally initialize the DB (run in one api pod):
Uninstall:

helm uninstall codepod-staging

Prod:

helm upgrade codepod-prod . --namespace codepod-prod --values=./values.prod.yaml
6 changes: 3 additions & 3 deletions k8s/helm-chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ kind: IngressRoute
metadata:
name: codepod-ingress
spec:
{{- if .Values.ingress.tls }}
{{- if .Values.tls.enabled }}
entryPoints:
- websecure
tls:
secretName: {{ .Values.ingress.tls.secretName }}
secretName: {{ .Values.tls.secretName }}
{{- end }}
routes:
- match: "Host(`{{ .Values.hostname }}`) && PathPrefix(`/`)"
Expand All @@ -40,7 +40,7 @@ spec:
- name: codepod-proxy-service
port: 4010

{{- if .Values.ingress.tls }}
{{- if .Values.tls.enabled }}
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
Expand Down
6 changes: 3 additions & 3 deletions k8s/helm-chart/values.prod.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hostname: "app.codepod.io"

ingress:
tls:
secretName: app-codepod-io-tls
tls:
enabled: true
secretName: app-codepod-io-tls
4 changes: 3 additions & 1 deletion k8s/helm-chart/values.staging.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
hostname: "codepod.127.0.0.1.sslip.io"
hostname: "codepod.208.87.130.238.sslip.io"
tls:
enabled: false
4 changes: 3 additions & 1 deletion k8s/helm-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
hostname: "codepod.127.0.0.1.sslip.io"
hostname: "codepod.127.0.0.1.sslip.io"
tls:
enabled: false
172 changes: 86 additions & 86 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
{
"name": "codepod",
"version": "v0.4.3-alpha.4",
"private": true,
"main": "./public/electron.js",
"homepage": "./",
"author": {
"name": "Hebi Li",
"email": "[email protected]"
},
"description": "My fantastic Electron app",
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"cpkernel": "file:../cpkernel",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"build": {
"appId": "com.electron.myapp",
"productName": "CodePod",
"files": [
"build/**/*",
"node_modules/**/*",
{
"from": "../ui/build",
"to": "build/ui",
"filter": [
"**/*"
]
}
],
"directories": {
"buildResources": "public"
},
"mac": {
"target": "dmg"
},
"win": {
"target": "nsis"
},
"linux": {
"target": "deb"
"name": "codepod",
"version": "0.4.3",
"private": true,
"main": "./public/electron.js",
"homepage": "./",
"author": {
"name": "Hebi Li",
"email": "[email protected]"
},
"description": "My fantastic Electron app",
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"cpkernel": "file:../cpkernel",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"build": {
"appId": "com.electron.myapp",
"productName": "CodePod",
"files": [
"build/**/*",
"node_modules/**/*",
{
"from": "../ui/build",
"to": "build/ui",
"filter": [
"**/*"
]
}
],
"directories": {
"buildResources": "public"
},
"scripts": {
"start": "PORT=13001 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"package": "electron-builder -mwl -c.extraMetadata.main=build/electron.js",
"electron:start": "concurrently -k \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:13001 && electronmon .\"",
"electron:package:mac": "npm run build && electron-builder -m -c.extraMetadata.main=build/electron.js",
"electron:package:win": "npm run build && electron-builder -w -c.extraMetadata.main=build/electron.js",
"electron:package:linux": "npm run build && electron-builder -l -c.extraMetadata.main=build/electron.js",
"dev": "concurrently -k \"cd ../ui && BROWSER=none npm run start\" \"cd ../cpkernel && npm run dev\" \"cross-env BROWSER=none npm run start\" \"wait-on http://127.0.0.1:13001 && wait-on http://127.0.0.1:14322 && electronmon .\"",
"build:cpkernel": "cd ./cpkernel && npm run build",
"build:ui": "cd ./ui && npm run build",
"build:app": "cd ./app && npm run build && npm run package",
"build:all-old": "cd ./cpkernel && npm run build && cd ../ui && npm run build && cd ../app && npm run build && npm run package",
"build:all": "npm run build:cpkernel && npm run build:ui && npm run build:app"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"mac": {
"target": "dmg"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"win": {
"target": "nsis"
},
"devDependencies": {
"concurrently": "^6.3.0",
"cross-env": "^7.0.3",
"electron": "^15.3.1",
"electron-builder": "^22.13.1",
"electronmon": "^2.0.2",
"wait-on": "^6.0.0"
"linux": {
"target": "deb"
}
}
},
"scripts": {
"start": "PORT=13001 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"package": "electron-builder -mwl -c.extraMetadata.main=build/electron.js",
"electron:start": "concurrently -k \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:13001 && electronmon .\"",
"electron:package:mac": "npm run build && electron-builder -m -c.extraMetadata.main=build/electron.js",
"electron:package:win": "npm run build && electron-builder -w -c.extraMetadata.main=build/electron.js",
"electron:package:linux": "npm run build && electron-builder -l -c.extraMetadata.main=build/electron.js",
"dev": "concurrently -k \"cd ../ui && BROWSER=none npm run start\" \"cd ../cpkernel && npm run dev\" \"cross-env BROWSER=none npm run start\" \"wait-on http://127.0.0.1:13001 && wait-on http://127.0.0.1:14322 && electronmon .\"",
"build:cpkernel": "cd ./cpkernel && npm run build",
"build:ui": "cd ./ui && npm run build",
"build:app": "cd ./app && npm run build && npm run package",
"build:all-old": "cd ./cpkernel && npm run build && cd ../ui && npm run build && cd ../app && npm run build && npm run package",
"build:all": "npm run build:cpkernel && npm run build:ui && npm run build:app"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"concurrently": "^6.3.0",
"cross-env": "^7.0.3",
"electron": "^15.3.1",
"electron-builder": "^22.13.1",
"electronmon": "^2.0.2",
"wait-on": "^6.0.0"
}
}
2 changes: 1 addition & 1 deletion ui/src/pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function About() {
textAlign: "center",
}}
>
<Box>CodePod version v0.4.3-alpha.4</Box>
<Box>CodePod version 0.4.3</Box>
</Box>
);
}
1 change: 1 addition & 0 deletions ui/src/pages/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function Profile() {
Name {me.firstname} {me.lastname}
</Box>
<Box> Email: {me.email}</Box>
<Box>CodePod version 0.4.3</Box>
</Stack>
</Paper>
<Divider />
Expand Down