-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
embedded-devices
example (#2384)
- Loading branch information
Showing
22 changed files
with
587 additions
and
730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,13 @@ | ||
ARG BASE_IMAGE_TYPE=cpu | ||
# these images have been pushed to Dockerhub but you can find | ||
# each Dockerfile used in the `base_images` directory | ||
FROM jafermarq/jetsonfederated_$BASE_IMAGE_TYPE:latest | ||
ARG BASE_IMAGE | ||
|
||
RUN apt-get install wget -y | ||
# Pull the base image from NVIDIA | ||
FROM $BASE_IMAGE | ||
|
||
# Download and extract CIFAR-10 | ||
# To keep things simple, we keep this as part of the docker image. | ||
# If the dataset is already in your system you can mount it instead. | ||
ENV DATA_DIR=/app/data/cifar-10 | ||
RUN mkdir -p $DATA_DIR | ||
WORKDIR $DATA_DIR | ||
RUN wget https://www.cs.toronto.edu/\~kriz/cifar-10-python.tar.gz | ||
RUN tar -zxvf cifar-10-python.tar.gz | ||
|
||
WORKDIR /app | ||
# Scripts needed for Flower client | ||
ADD client.py /app | ||
ADD utils.py /app | ||
|
||
# update pip | ||
# Update pip | ||
RUN pip3 install --upgrade pip | ||
|
||
# making sure the latest version of flower is installed | ||
RUN pip3 install flwr>=1.0.0 | ||
# Install flower | ||
RUN pip3 install flwr>=1.0 | ||
RUN pip3 install tqdm==4.65.0 | ||
|
||
ENTRYPOINT ["python3","-u","./client.py"] | ||
WORKDIR /client |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "${CI}" ]; then | ||
BUILDKIT=1 | ||
else | ||
BUILDKIT=0 | ||
fi | ||
|
||
# This script build a docker image that's ready to run your flower client. | ||
# Depending on your choice of ML framework (TF or PyTorch), the appropiate | ||
# base image from NVIDIA will be pulled. This ensures you get the best | ||
# performance out of your Jetson device. | ||
|
||
BASE_PYTORCH=nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.13-py3 | ||
BASE_TF=nvcr.io/nvidia/l4t-tensorflow:r35.3.1-tf2.11-py3 | ||
EXTRA="" | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
-p|--pytorch) | ||
BASE_IMAGE=$BASE_PYTORCH | ||
shift | ||
;; | ||
-t|--tensorflow) | ||
BASE_IMAGE=$BASE_TF | ||
shift | ||
;; | ||
-r|--no-cache) | ||
EXTRA="--no-cache" | ||
shift | ||
;; | ||
-*|--*) | ||
echo "Unknown option $1 (pass either --pytorch or --tensorflow)" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
DOCKER_BUILDKIT=${BUILDKIT} docker build $EXTRA \ | ||
--build-arg BASE_IMAGE=$BASE_IMAGE \ | ||
. \ | ||
-t flower_client:latest |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.