Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 28 additions & 63 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand All @@ -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
10 changes: 4 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ channels:
- conda-forge

dependencies:
- python
- wheel
- ipykernel
- numpy
- pandas
- seaborn
Expand All @@ -15,8 +16,5 @@ dependencies:
- s3fs
- dvc
- dvc-s3
- pip:
- fasttext
- pyyaml
- xlrd
- jupyter
- pyyaml
- xlrd
18 changes: 0 additions & 18 deletions requirements.txt

This file was deleted.

4 changes: 4 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"workbench.colorTheme": "Default Dark+",
"python.defaultInterpreterPath": "/home/coder/local/bin/conda/envs/basesspcloud/bin/python"
}