.gitpod.Dockerfile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. FROM gitpod/workspace-base:latest
  2. ### Java ###
  3. USER gitpod
  4. RUN curl -fsSL "https://get.sdkman.io" | bash \
  5. && bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
  6. && sdk install java 8.0.292.j9-adpt \
  7. && sdk install maven \
  8. && sdk flush archives \
  9. && sdk flush temp \
  10. && mkdir /home/gitpod/.m2 \
  11. && printf '<settings>\n <localRepository>/tmp/m2-repository/</localRepository>\n</settings>\n' > /home/gitpod/.m2/settings.xml \
  12. && echo 'export SDKMAN_DIR=\"/home/gitpod/.sdkman\"' >> /home/gitpod/.bashrc.d/99-java \
  13. && echo '[[ -s \"/home/gitpod/.sdkman/bin/sdkman-init.sh\" ]] && source \"/home/gitpod/.sdkman/bin/sdkman-init.sh\"' >> /home/gitpod/.bashrc.d/99-java \
  14. && sudo mkdir -p /fateboard && sudo chown gitpod:gitpod /fateboard"
  15. ### fateboard ###
  16. USER gitpod
  17. COPY --chown=gitpod:gitpod fateboard /fateboard/repo
  18. RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
  19. && printf '<settings>\n <localRepository>/tmp/m2-repository/</localRepository>\n</settings>\n' > /home/gitpod/.m2/settings.xml \
  20. && mvn -f /fateboard/repo/pom.xml package \
  21. && rm -rf /tmp/m2-repository \
  22. && printf '<settings>\n <localRepository>/workspace/m2-repository/</localRepository>\n</settings>\n' > /home/gitpod/.m2/settings.xml" \
  23. && find /fateboard/repo/target -iname 'fateboard-*.jar' -exec cp {} /fateboard/fateboard.jar \; \
  24. && mkdir -p /fateboard/resources \
  25. && cp /fateboard/repo/src/main/resources/ssh.properties /fateboard/resources/ \
  26. && cp /fateboard/repo/src/main/resources/application.properties /fateboard/resources/ \
  27. && sed -i 's#fateboard.datasource.jdbc-url=.*#fateboard.datasource.jdbc-url=jdbc:sqlite:/workspace/FATE/fate_sqlite.db#' /fateboard/resources/application.properties \
  28. && sudo rm -rf /fateboard/repo
  29. ### Python ###
  30. USER root
  31. RUN apt-get update && apt-get install libgmp3-dev -y && apt-get install -y libmpfr-dev libmpfr-doc libmpfr6 && apt-get install libmpc-dev -y
  32. RUN mkdir -p /venv && chown gitpod:gitpod /venv
  33. USER gitpod
  34. RUN sudo install-packages python3-pip
  35. COPY python/requirements.txt /tmp/requirements.txt
  36. COPY doc/mkdocs/requirements.txt /tmp/requirements_mkdocs.txt
  37. ENV PIP_USER=
  38. ENV PYTHONUSERBASE=
  39. ENV PATH=$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH
  40. RUN curl -fsSL https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
  41. && { echo; \
  42. echo 'eval "$(pyenv init -)"'; \
  43. echo 'eval "$(pyenv virtualenv-init -)"'; } >> /home/gitpod/.bashrc.d/60-python \
  44. && pyenv update \
  45. && pyenv install 3.6.15 \
  46. && $HOME/.pyenv/versions/3.6.15/bin/python -m venv /venv/py36 --system-site-packages \
  47. && /venv/py36/bin/python -m pip install --no-cache-dir --upgrade pip \
  48. && /venv/py36/bin/python -m pip install --no-cache-dir --upgrade setuptools wheel virtualenv pipenv pylint rope flake8 \
  49. mypy autopep8 pep8 pylama pydocstyle bandit notebook twine jedi black isort \
  50. && /venv/py36/bin/python -m pip install --no-cache-dir -r /tmp/requirements.txt \
  51. && pyenv install 3.7.12 \
  52. && $HOME/.pyenv/versions/3.7.12/bin/python -m venv /venv/mkdocs --system-site-packages \
  53. && /venv/mkdocs/bin/python -m pip install --no-cache-dir --upgrade pip \
  54. && /venv/mkdocs/bin/python -m pip install --no-cache-dir -r /tmp/requirements_mkdocs.txt \
  55. && sudo rm -rf /tmp/* \
  56. && pyenv global 3.6.15
  57. COPY python/fate_client /venv/fate_client
  58. RUN /venv/py36/bin/python -m pip install --no-cache-dir /venv/fate_client \
  59. && /venv/py36/bin/pipeline init --ip 127.0.0.1 --port 9380 \
  60. && /venv/py36/bin/flow init --ip 127.0.0.1 --port 9380 \
  61. && sudo rm -rf /tmp/*
  62. COPY python/fate_test /venv/fate_test
  63. RUN /venv/py36/bin/python -m pip install --no-cache-dir /venv/fate_test \
  64. && /venv/py36/bin/fate_test config \
  65. && sed -i 's#data_base_dir:.*#data_base_dir: /workspace/FATE#' /venv/py36/lib/python3.6/site-packages/fate_test/fate_test_config.yaml \
  66. && sed -i 's#fate_base:.*#fate_base: /workspace/FATE#' /venv/py36/lib/python3.6/site-packages/fate_test/fate_test_config.yaml \
  67. && sudo rm -rf /tmp/*
  68. ### Docker ###
  69. LABEL dazzle/layer=tool-docker
  70. LABEL dazzle/test=tests/tool-docker.yaml
  71. USER root
  72. ENV TRIGGER_REBUILD=3
  73. # https://docs.docker.com/engine/install/ubuntu/
  74. RUN curl -o /var/lib/apt/dazzle-marks/docker.gpg -fsSL https://download.docker.com/linux/ubuntu/gpg \
  75. && apt-key add /var/lib/apt/dazzle-marks/docker.gpg \
  76. && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
  77. && install-packages docker-ce docker-ce-cli containerd.io
  78. RUN curl -o /usr/bin/slirp4netns -fsSL https://github.com/rootless-containers/slirp4netns/releases/download/v1.1.12/slirp4netns-$(uname -m) \
  79. && chmod +x /usr/bin/slirp4netns
  80. RUN curl -o /usr/local/bin/docker-compose -fsSL https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 \
  81. && chmod +x /usr/local/bin/docker-compose
  82. # https://github.com/wagoodman/dive
  83. RUN curl -o /tmp/dive.deb -fsSL https://github.com/wagoodman/dive/releases/download/v0.10.0/dive_0.10.0_linux_amd64.deb \
  84. && apt install /tmp/dive.deb \
  85. && rm /tmp/dive.deb