diff --git a/Dockerfile b/Dockerfile index 96c2ce3..b4e4038 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,27 @@ FROM codercom/code-server:4.0.1 +ARG PYTHON_VERSION=3.10 RUN sudo apt-get -y update && \ sudo apt-get -y install wget \ - python3-pip \ - pipenv \ cmake \ jq \ - bash-completion - + bash-completion \ + vim + +# Install kubectl RUN sudo wget "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" -O /usr/local/bin/kubectl && \ sudo chmod +x /usr/local/bin/kubectl - RUN sudo sh -c "kubectl completion bash >/etc/bash_completion.d/kubectl" +# Install helm RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && \ chmod 700 get_helm.sh && \ ./get_helm.sh +# Install mc RUN sudo wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/local/bin/mc && \ sudo chmod +x /usr/local/bin/mc - # Install vault RUN sudo apt-get install -y unzip RUN cd /usr/bin && \ @@ -29,70 +30,34 @@ RUN cd /usr/bin && \ sudo rm vault_1.8.4_linux_amd64.zip RUN sudo vault -autocomplete-install - -ENV PYTHONPATH="${PYTHONPATH}:/home/coder/.local/bin" -ENV PATH="/home/coder/.local/bin:${PATH}" -ADD requirements.txt /home/coder/requirements.txt -RUN pip3 install --upgrade -r /home/coder/requirements.txt -RUN rm /home/coder/requirements.txt - - -# INSTALL VSTUDIO EXTENSIONS - -RUN code-server --install-extension ms-python.python -RUN code-server --install-extension ms-kubernetes-tools.vscode-kubernetes-tools -RUN code-server --install-extension redhat.vscode-yaml - -RUN code-server --install-extension coenraads.bracket-pair-colorizer -RUN code-server --install-extension eamodio.gitlens -RUN code-server --install-extension ms-azuretools.vscode-docker -#RUN code-server --install-extension ms-python.vscode-pylance -#RUN code-server --install-extension ms-toolsai.jupyter -RUN code-server --install-extension dongli.python-preview -RUN code-server --install-extension njpwerner.autodocstring -RUN code-server --install-extension bierner.markdown-emoji - - -#ADD vscode-settings.json /home/coder/.local/share/code-server/User/settings.json - - - # INSTALL MINICONDA ------------------------------- - -RUN wget \ - https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -#RUN sudo mkdir -p /home/coder/local/bin/conda - -RUN sudo bash Miniconda3-latest-Linux-x86_64.sh -b -p /home/coder/local/bin/conda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh +RUN bash Miniconda3-latest-Linux-x86_64.sh -b -p /home/coder/local/bin/conda RUN rm -f Miniconda3-latest-Linux-x86_64.sh -RUN sudo useradd -s /bin/bash miniconda - -RUN sudo chown -R miniconda:miniconda /home/coder/local/bin/conda \ - && sudo chmod -R go-w /home/coder/local/bin/conda - -RUN sudo ln -s /home/coder/local/bin/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh - +# Install mamba (speed up packages install with conda) +# Must be in base conda env ENV PATH="/home/coder/local/bin/conda/bin:${PATH}" -RUN conda --version +RUN conda install mamba -n base -c conda-forge -# Create the environment: +# Install env requirements +RUN conda create -n basesspcloud python=$PYTHON_VERSION COPY environment.yml . -RUN conda env create -f environment.yml -n basesspcloud - - -# MAKE SURE THE basesspcloud CONDAENV IS USED ---------------- - -ENV CONDA_DEFAULT_ENV="basesspcloud" - +RUN mamba env update -n basesspcloud -f environment.yml +ENV PATH="/home/coder/local/bin/conda/envs/basesspcloud/bin:${PATH}" -RUN echo "alias pip=pip3" >> ~/.bashrc -RUN echo "alias python=python3" >> ~/.bashrc - -#RUN echo "conda activate basesspcloud" >> ~/.bashrc -RUN echo "{\"workbench.colorTheme\": \"Default Dark+\", \"python.pythonPath\": \"/home/coder/.conda/envs/basesspcloud/bin\"}" >> /home/coder/.local/share/code-server/User/settings.json +# Put additional VSCode settings in remote configuration +RUN mkdir -p /home/coder/.local/share/code-server/Machine/ +COPY settings.json /home/coder/.local/share/code-server/Machine/settings.json # Nice colors in python terminal -RUN echo "import sys ; from IPython.core.ultratb import ColorTB ; sys.excepthook = ColorTB() ;" >> /home/coder/.conda/envs/basesspcloud/lib/python3.9/site-packages/sitecustomize.py +RUN echo "import sys ; from IPython.core.ultratb import ColorTB ; sys.excepthook = ColorTB() ;" >> /home/coder/local/bin/conda/envs/basesspcloud/lib/python${PYTHON_VERSION}/site-packages/sitecustomize.py + +# INSTALL VSTUDIO EXTENSIONS +RUN code-server --install-extension ms-python.python +RUN code-server --install-extension ms-kubernetes-tools.vscode-kubernetes-tools +RUN code-server --install-extension eamodio.gitlens +RUN code-server --install-extension ms-azuretools.vscode-docker +RUN code-server --install-extension njpwerner.autodocstring -ENV PATH="/home/coder/.conda/envs/basesspcloud/bin:$PATH" +RUN echo $PATH diff --git a/environment.yml b/environment.yml index 1e36bb4..073e51a 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,8 @@ channels: - conda-forge dependencies: - - python + - wheel + - ipykernel - numpy - pandas - seaborn @@ -15,8 +16,5 @@ dependencies: - s3fs - dvc - dvc-s3 - - pip: - - fasttext - - pyyaml - - xlrd - - jupyter + - pyyaml + - xlrd diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 240126b..0000000 --- a/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -wheel -pandas -datetime -unidecode -scikit-learn -xgboost -pylint -#cython -#nltk -#spacy -#tensorflow -#btbpy -#keras -#kerasvis -#torch -#spark -#pyspark -#descartes diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..a4cc359 --- /dev/null +++ b/settings.json @@ -0,0 +1,4 @@ +{ + "workbench.colorTheme": "Default Dark+", + "python.defaultInterpreterPath": "/home/coder/local/bin/conda/envs/basesspcloud/bin/python" +} \ No newline at end of file