Skip to content

Commit

Permalink
Successfully build an image in which import tensorflow_federated succ…
Browse files Browse the repository at this point in the history
…eeds

* Upgrade to Python 3.10

* Install a bunch of missing git packages

* Ran into #3
  which can be fixed by upgrading pandas

* set_image.sh is a helper script to update the base image in vscode.
  • Loading branch information
jlewi committed Aug 2, 2022
1 parent 70bae58 commit 9b0745c
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 27 deletions.
3 changes: 3 additions & 0 deletions dlbase/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions dlbase/aptget-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
emacs
g++
gcc
git
jq
linux-libc-dev
make
wget
13 changes: 13 additions & 0 deletions dlbase/set_image.sh
Original file line number Diff line number Diff line change
@@ -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}
7 changes: 2 additions & 5 deletions dlbase/testpod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion vscode/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions vscode/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 19 additions & 19 deletions vscode/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}

0 comments on commit 9b0745c

Please sign in to comment.