Skip to content

Commit 21b84b7

Browse files
committed
fix theia
Signed-off-by: Chris Snow <[email protected]>
1 parent 7da7bf2 commit 21b84b7

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

Dockerfile

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
FROM theiaide/theia-python:latest
22

3-
COPY requirements.txt /tmp
3+
ENV DEBIAN_FRONTEND noninteractive
44

5-
## User account
6-
RUN adduser --disabled-password --gecos '' theia && \
7-
adduser theia sudo && \
8-
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
9-
chown -R theia:theia /home/theia
5+
COPY requirements.txt /tmp
106

117
RUN apt-get update \
12-
&& apt-get install -y vim yarn \
8+
&& apt-get install -y vim yarn sudo \
139
&& apt-get install -y make build-essential libssl-dev zlib1g-dev \
1410
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
1511
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \
@@ -18,14 +14,19 @@ RUN apt-get update \
1814
&& rm -rf /var/cache/apt/* \
1915
&& rm -rf /var/lib/apt/lists/*
2016

17+
## User account
18+
RUN adduser --disabled-password --gecos '' theia && \
19+
adduser theia sudo && \
20+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
21+
chown -R theia:theia /home/theia
22+
23+
2124
USER theia
2225
WORKDIR /home/theia
2326

2427
# Python2 and Python3 are installed by parent Dockerfile:
2528
# https://github.com/theia-ide/theia-apps/blob/master/theiaide/theia-python/Dockerfile
26-
27-
# Save the preinstalled python paths - do this before setting up pyenv because pyenv may report
28-
# different binaries with which.
29+
# Here we save the preinstalled python paths because we need to use them later.
2930

3031
RUN which python > ~/python2_path
3132
RUN which python3 > ~/python3_path
@@ -52,19 +53,17 @@ RUN export PATH=/home/theia/.pyenv/bin:$PATH; \
5253
&& pyenv local $(pyenv versions --bare) \
5354
&& pyenv versions
5455

55-
# RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
56-
# && sudo python get-pip.py
5756

5857
USER root
5958

6059
RUN echo "Installing python modules" \
6160
&& PY_PATHS=$(ls -1 /home/theia/.pyenv/versions/*/bin/python?.? && cat /home/theia/python3_path && cat /home/theia/python2_path) \
62-
&& PY_PATHS=$(cat /home/theia/python3_path && cat /home/theia/python2_path) \
63-
&& for v in ${PY_PATHS}; do ${v} -m pip install --upgrade pip setuptools wheel; done \
64-
&& for v in ${PY_PATHS}; do ${v} -m pip install --upgrade tox tox-pyenv ipython pylint pytest mock nose flake8 flake8-docstrings autopep8; done \
65-
&& /home/theia/.pyenv/versions/*/bin/python3.8 -m pip install -U black isort python-language-server sphinx\
61+
&& for v in ${PY_PATHS}; do echo "******* ${v} *******"; ${v} -m pip install --upgrade pip setuptools wheel; done \
62+
&& for v in ${PY_PATHS}; do echo "******* ${v} *******"; ${v} -m pip install --upgrade tox tox-pyenv ipython pylint pytest mock nose flake8 flake8-docstrings autopep8; done \
63+
&& /home/theia/.pyenv/versions/*/bin/python3.8 -m pip install -U black isort sphinx \
6664
&& ln -f -s /home/theia/.pyenv/versions/*/bin/black /bin/ \
6765
&& ln -f -s /home/theia/.pyenv/versions/*/bin/isort /bin/ \
66+
&& ln -f -s /home/theia/.pyenv/versions/*/bin/sphinx /bin/ \
6867
&& for v in ${PY_PATHS}; do ${v} -m pip install -r /tmp/requirements.txt; done
6968

7069
RUN chown -R theia:theia /home/theia

pre_push_verifications.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,8 @@ black bin/ tests/ hpecp/
77

88
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
99
flake8 --docstring-convention numpy bin/ hpecp/
10-
1110
flake8 --ignore=D,E501 tests/ # verify tests, but not for documentation
1211

13-
# if [[ -d /home/theia/ ]];
14-
# then
15-
# # ensure pyenvs are available to tox
16-
# eval "$(pyenv init -)"
17-
# ls -1 ~/.pyenv/versions/ > /root/.python-version
18-
# pyenv shell $(ls -1 ~/.pyenv/versions/)
19-
# fi
20-
2112
tox -- tests/
2213

2314
# coverage causes some tests to fail on PY3 so test it (issues 93)

0 commit comments

Comments
 (0)