-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
80 lines (55 loc) · 2.31 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Declare the CONFIG argument at the beginning
ARG CONFIG=base
# Base stage for common setup
FROM golang as base
# Install gcc and other necessary tools
# we need gcc for Golang SQLite bc uses C code
RUN apt-get update && \
apt-get install -y gcc && \
apt-get install -y protobuf-compiler && \
apt-get clean
# Set CGO_ENABLED=1 , we need this for Golang SQLite bc uses C code
ENV CGO_ENABLED=1
# Set the Current Working Directory inside the container
WORKDIR /app
# Install Python and pip.
# Debian's package manager is used to install Python and pip.
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/bin/python3 /usr/bin/python
# Upgrade pip to its latest version.
RUN python3 -m pip install --upgrade pip --break-system-packages
# Install grpcio using pip.
RUN python3 -m pip install grpcio --break-system-packages
RUN python3 -m pip install grpcio-tools --break-system-packages
# For figure10b
# RUN python3 -m pip install matplotlib
#
RUN go install google.golang.org/protobuf/cmd/[email protected]
RUN go install google.golang.org/grpc/cmd/[email protected]
# just to test things out
RUN apt update && apt install -y iputils-ping
# Create the required directory structure
RUN mkdir -p go
# Copy the go.mod and go.sum files into the go directory
COPY go/go.mod go/go.sum go/
# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN cd go && go mod download
# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .
# now that we've installed pre-reqs, build everything
RUN make clean && make go && make py && make build
ENV PROJECT_ROOT=/app
FROM base as driver
# install necessary Python packages to run anything
RUN python3 -m pip install cloudpickle posix_ipc --break-system-packages
RUN cd python && python3 -m pip install -e . --break-system-packages
# install basic necessities to actually do driver stuff
RUN apt install -y nano
# install testing
RUN python3 -m pip install pytest --break-system-packages
# take in a CONFIG argument which will tell us what to target (GCS, global scheduler, or worker)
# using multi-stage builds: https://chat.openai.com/share/a5eb4076-e36a-4a1e-b4c8-9d56ea7a604e
FROM ${CONFIG} as final