Skip to content

Commit 02282cc

Browse files
authored
feat(docker): slim docker images (#36)
* chore: bump cpp-sysroot dep * fix(docker): comment out rotten bits * fix(pyfaasm): remove unnecessary global keywords
1 parent 0a0e9a7 commit 02282cc

File tree

5 files changed

+27
-23
lines changed

5 files changed

+27
-23
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
if: github.event.pull_request.draft == false
2121
runs-on: ubuntu-latest
2222
container:
23-
image: ghcr.io/faasm/cpython:0.4.0
23+
image: ghcr.io/faasm/cpython:0.5.0
2424
steps:
2525
- name: "Fetch code"
2626
uses: actions/checkout@v4
@@ -41,7 +41,7 @@ jobs:
4141
REDIS_QUEUE_HOST: redis
4242
REDIS_STATE_HOST: redis
4343
container:
44-
image: ghcr.io/faasm/cpython:0.4.0
44+
image: ghcr.io/faasm/cpython:0.5.0
4545
services:
4646
redis:
4747
image: redis

Dockerfile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
FROM ghcr.io/faasm/cpp-sysroot:0.4.0
1+
FROM ghcr.io/faasm/cpp-sysroot:0.8.0
22
ARG FAASM_PYTHON_VERSION
33

44
SHELL ["/bin/bash", "-c"]
55
ENV PYTHON_DOCKER="on"
66

7-
RUN apt update && apt install -y libssl-dev
7+
RUN apt update \
8+
&& apt install -y --no-install-recommends \
9+
dpkg-dev \
10+
libssl-dev \
11+
pkg-config \
12+
wget \
13+
zlib1g \
14+
zlib1g-dev \
15+
&& apt autoremove -y \
16+
&& apt clean; rm -rf /var/lib/apt/lists/*
817

918
# Clone code and submodules
1019
RUN mkdir -p /code \
@@ -30,21 +39,21 @@ RUN cd /code/python \
3039
cpython.func
3140

3241
# Build cross-compiled python modules, including `pyfaasm`
33-
RUN cd /code/python \
34-
&& ./bin/crossenv_setup.sh \
35-
&& source ./cross_venv/bin/activate \
36-
&& pip3 install -r crossenv/requirements.txt \
37-
&& inv -r crossenv modules.build
42+
# RUN cd /code/python \
43+
# && ./bin/crossenv_setup.sh \
44+
# && source ./cross_venv/bin/activate \
45+
# && pip3 install -r crossenv/requirements.txt \
46+
# && inv -r crossenv modules.build
3847

39-
# Finally, install the cross-compiled Python modules
40-
RUN cd /code/python \
41-
&& source ./venv/bin/activate \
42-
&& inv modules.install
48+
# # Finally, install the cross-compiled Python modules
49+
# RUN cd /code/python \
50+
# && source ./venv/bin/activate \
51+
# && inv modules.install
4352

4453
# TODO: Install experimental pacakges
4554
# RUN . ./cross_venv/bin/activate && inv libs.install --experimental
4655

4756
WORKDIR /code/python
48-
ENV TERM xterm-256color
57+
ENV TERM=xterm-256color
4958
RUN sed -i 's/\/code\/cpp\/bin/\/code\/python\/bin/g' ~/.bashrc
5059
CMD ["/bin/bash", "-l"]

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0
1+
0.5.0

pyfaasm/pyfaasm/core.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717

1818
def get_env_bool(var_name):
19-
global env_cache
20-
2119
if var_name not in env_cache:
2220
value = os.environ.get(var_name)
2321
env_cache[var_name] = bool(value)
@@ -26,7 +24,6 @@ def get_env_bool(var_name):
2624

2725

2826
def set_env_bool(var_name, value):
29-
global env_cache
3027
env_cache[var_name] = value
3128

3229

@@ -76,7 +73,6 @@ def write_output(output):
7673

7774
def get_output():
7875
if is_local_output():
79-
global output_data
8076
return output_data
8177
else:
8278
raise RuntimeError(

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
black==22.3.0
2-
faasmctl==0.13.0
3-
flake8==3.9.2
1+
black>=23.12.0
2+
faasmctl>=0.51.0
3+
flake8>=7.0.0
44
invoke>=2.0.0
5-
numpy==1.22.0
65
requests>=2.31.0

0 commit comments

Comments
 (0)