From 3fb3616ad8e93f35fb9fdb8285c0a0f1bc0992c2 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 9 Jun 2020 15:02:09 +0300 Subject: [PATCH 1/7] Add Dockerfile for `grumpy` It is Ubuntu 20.04 with Python 2. Still not clear how to run `grumpy` directly from source. /app/grumpy-tools-src# python2 grumpy_tools /usr/bin/python2: can't find '__main__' module in 'grumpy_tools' Need some helper scripts. --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..76aa1be7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ubuntu:20.04 + +RUN apt-get update && apt-get install -y \ + python2 \ + && rm -rf /var/lib/apt/lists/* + +COPY . /app +WORKDIR /app + From 7a3b4094e83967a2a034b499ee133954d6be1d60 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 16 Jun 2020 10:46:54 +0300 Subject: [PATCH 2/7] Install `pip` for Python 2 Python 2 `pip` is not packaged for 20.04 --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 76aa1be7..c2e9d8ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,12 @@ FROM ubuntu:20.04 +# Grumpy is not ported to Python 3 yet RUN apt-get update && apt-get install -y \ + curl \ python2 \ && rm -rf /var/lib/apt/lists/* +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python2 get-pip.py + COPY . /app WORKDIR /app From 12062532a33104dad32f623d86d2ed03365b2928 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 16 Jun 2020 10:54:11 +0300 Subject: [PATCH 3/7] At least `regex` dependency needs `gcc` and Python headers --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c2e9d8ca..b9067128 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,8 @@ FROM ubuntu:20.04 # Grumpy is not ported to Python 3 yet RUN apt-get update && apt-get install -y \ curl \ - python2 \ + gcc \ + python2-dev \ && rm -rf /var/lib/apt/lists/* RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python2 get-pip.py @@ -11,3 +12,7 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python2 get-pip.p COPY . /app WORKDIR /app + +# Install in editable mode +RUN cd grumpy-tools-src && pip install --editable . + From 60f24eb6c1bf27e56b5f954a9760dcbac2300575 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 16 Jun 2020 11:40:53 +0300 Subject: [PATCH 4/7] `make` is needed to `grumpy-runtime` to be built --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b9067128..a3f9f90c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ FROM ubuntu:20.04 RUN apt-get update && apt-get install -y \ curl \ gcc \ + make \ python2-dev \ && rm -rf /var/lib/apt/lists/* RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python2 get-pip.py @@ -13,6 +14,10 @@ COPY . /app WORKDIR /app -# Install in editable mode +# Install tools in editable mode. Some `grumpy` commands need run-time, and +# run-time needs at least `grumpy run` to be built. RUN cd grumpy-tools-src && pip install --editable . +# Install run-time +RUN cd grumpy-runtime-src && pip install --editable . + From b92380d1ce7fd966c8d160466ec2e9c3707b6325 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 16 Jun 2020 11:46:11 +0300 Subject: [PATCH 5/7] Install `go` for runtime --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index a3f9f90c..1cc68c63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ FROM ubuntu:20.04 RUN apt-get update && apt-get install -y \ curl \ gcc \ + golang \ make \ python2-dev \ && rm -rf /var/lib/apt/lists/* From 549b0edbd943bc50f52786a0d21e8ada425bf494 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 16 Jun 2020 11:56:47 +0300 Subject: [PATCH 6/7] Add hack to skip `tzinfo` questions --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1cc68c63..4df4e350 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,11 @@ FROM ubuntu:20.04 -# Grumpy is not ported to Python 3 yet + +# Installing Python 2, because Grumpy is not ported to Python 3 yet + +# Go for run-time pulls tzdata, which asks interactive questions +# https://stackoverflow.com/questions/44331836/apt-get-install-tzdata-noninteractive +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ curl \ gcc \ From 3a566e9103980541ee2034e593d8cba6ebcba3d5 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 16 Jun 2020 12:21:25 +0300 Subject: [PATCH 7/7] Do not install runtime in editable mode (#152) --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4df4e350..03534fba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,6 @@ WORKDIR /app # run-time needs at least `grumpy run` to be built. RUN cd grumpy-tools-src && pip install --editable . -# Install run-time -RUN cd grumpy-runtime-src && pip install --editable . +# Install run-time in non-editable mode +RUN cd grumpy-runtime-src && pip install .