diff --git a/dlbase/Makefile b/dlbase/Makefile index db33ed0..aa72bad 100644 --- a/dlbase/Makefile +++ b/dlbase/Makefile @@ -9,6 +9,9 @@ build: build-dir # error copying logs to stdout: invalid write result $(SKAFFOLD) build -v info --timestamps=true --file-output .build/image.json +# update the base image in the vscode image +update-image: build + ./set_image.sh # Deploy the testpod apply: diff --git a/dlbase/aptget-requirements.txt b/dlbase/aptget-requirements.txt index b6912b9..d5286f8 100644 --- a/dlbase/aptget-requirements.txt +++ b/dlbase/aptget-requirements.txt @@ -1,4 +1,8 @@ emacs +g++ +gcc git jq +linux-libc-dev +make wget \ No newline at end of file diff --git a/dlbase/set_image.sh b/dlbase/set_image.sh new file mode 100755 index 0000000..ce4f502 --- /dev/null +++ b/dlbase/set_image.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Update the base image to the latest built image. +set -x + +ROOT=$(git rev-parse --show-toplevel) + + +NEWBASE=$(yq e ".builds[0].tag" ${ROOT}/dlbase/.build/image.json) + +yq e ".build.artifacts[0].kaniko.buildArgs.BASE_IMAGE = \"${NEWBASE}\"" -i ${ROOT}/vscode/skaffold.yaml + +cd ${ROOT}/dlbase/testpod/ +kustomize edit set image base-cpu=${NEWBASE} \ No newline at end of file diff --git a/dlbase/testpod/kustomization.yaml b/dlbase/testpod/kustomization.yaml index da3cea4..2c1bbb8 100644 --- a/dlbase/testpod/kustomization.yaml +++ b/dlbase/testpod/kustomization.yaml @@ -8,9 +8,6 @@ labels: resources: - statefulset.yaml images: -# - name: base-cpu -# newName: gcr.io/deeplearning-platform-release/base-cpu -# newTag: latest -- digest: sha256:238bce3b0a044ba52771d0a2b2a7aceb462c115849ad6642f1156a04f1ae52bc +- digest: sha256:2956e095a09b22d358f78e34d7b807469e115d68733fb7539580a0318a8c6971 name: base-cpu - newName: gcr.io/dev-bytetoko/google-deep-learning/base-cpu + newName: gcr.io/dev-bytetoko/google-deep-learning/base-cpu:70bae58-dirty diff --git a/vscode/Dockerfile b/vscode/Dockerfile index 59e9153..e0fcb75 100644 --- a/vscode/Dockerfile +++ b/vscode/Dockerfile @@ -8,7 +8,12 @@ USER root # Install TensorFlow federated. This should pull in the corresponding version of # TensorFlow. -RUN pip install --upgrade tensorflow-federated +RUN pip install --upgrade tensorflow-federated==0.32.0 + +# See: https://github.com/bytetoko/devboxes/issues/3 +# we need to override the version of pandas installed by tensorflow-federated +# as workaround for bytetoko/devboxes#3 +RUN pip install --upgrade pandas~=1.4.3 # Install supervisord as we will use it to run ssh RUN python -m pip install supervisor supervisord-dependent-startup diff --git a/vscode/kustomization.yaml b/vscode/kustomization.yaml index 12e7be5..cc0e6a7 100644 --- a/vscode/kustomization.yaml +++ b/vscode/kustomization.yaml @@ -11,6 +11,6 @@ resources: - pvc.yaml - sa.yaml images: -- digest: sha256:f32338a3cf788da1fcac045efd662895f920fb96cf8fc6a3e43c4418cf6e7b49 +- digest: sha256:01067857cbae710e2854fed3ee62b9c48a54a808457a0325ec55a75efd07e4fe name: tensorflow - newName: gcr.io/dev-bytetoko/devbox + newName: gcr.io/dev-bytetoko/devbox:70bae58-dirty diff --git a/vscode/skaffold.yaml b/vscode/skaffold.yaml index 91c74d8..e04053f 100644 --- a/vscode/skaffold.yaml +++ b/vscode/skaffold.yaml @@ -4,30 +4,30 @@ metadata: name: vscode build: artifacts: - - image: gcr.io/dev-bytetoko/devbox - context: . - kaniko: - dockerfile: Dockerfile - buildArgs: - BASE_IMAGE: gcr.io/dev-bytetoko/google-deep-learning/base-cpu:5d10c9d@sha256:27509b1bbda817ce4cbc09d75658ef58acf0a106f0b2692eb092e3cb72ff0d60 - logTimestamp: true + - image: gcr.io/dev-bytetoko/devbox + context: . + kaniko: + dockerfile: Dockerfile + buildArgs: + BASE_IMAGE: gcr.io/dev-bytetoko/google-deep-learning/base-cpu:70bae58-dirty@sha256:2956e095a09b22d358f78e34d7b807469e115d68733fb7539580a0318a8c6971 + logTimestamp: true # Due to https://github.com/GoogleContainerTools/skaffold/issues/7701 # Try using googleCloudBuild rather than building in cluster. googleCloudBuild: projectId: dev-bytetoko machineType: E2_HIGHCPU_32 timeout: 3600s - # cluster: - # namespace: kaniko - # serviceAccount: kaniko - # resources: - # requests: - # cpu: 4 - # memory: 8Gi - # ephemeralStorage: 30Gi - # limits: - # cpu: 4 - # memory: 8Gi - # ephemeralStorage: 30Gi + # cluster: + # namespace: kaniko + # serviceAccount: kaniko + # resources: + # requests: + # cpu: 4 + # memory: 8Gi + # ephemeralStorage: 30Gi + # limits: + # cpu: 4 + # memory: 8Gi + # ephemeralStorage: 30Gi deploy: kustomize: {}