Skip to content

Commit 70cc8dc

Browse files
authored
Intégration aux environnements conda 🐍 et ajout d'extensions (#14)
* custom CI * conda env * run conda * run miniconda * run miniconda * ls * essaie avec guillemets * run chmod * essaye comme ça * bash * change chmod * sudo mkdir * change dir created * erreur * change option * ici sudpo * sudo là * change path to usrlocal * sudo * change conda path * homecoder * essai * change name * simplifie * un exemple * path anaconda * activate * conda activate * test ENTRYPOINT * add to PATH * set pythonpath * change name * change location * add to python path * retire ajout python path * retire conda activate pour test * install quelques extensions * typo * ajoute extensions * utilise un thème sombre + jupyter dans l'env * readme * retour du CI * Update ci.yml * color highligh in python terminal * test ajout syntax highlighting * Delete ci_lg.yml
1 parent bb6253a commit 70cc8dc

3 files changed

Lines changed: 87 additions & 0 deletions

File tree

Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,64 @@ ENV PATH="/home/coder/.local/bin:${PATH}"
2525
ADD requirements.txt /home/coder/requirements.txt
2626
RUN pip3 install --upgrade -r /home/coder/requirements.txt
2727
RUN rm /home/coder/requirements.txt
28+
29+
30+
# INSTALL VSTUDIO EXTENSIONS
31+
2832
RUN code-server --install-extension ms-python.python
2933
RUN code-server --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
3034
RUN code-server --install-extension redhat.vscode-yaml
35+
36+
RUN code-server --install-extension coenraads.bracket-pair-colorizer
37+
RUN code-server --install-extension eamodio.gitlens
38+
RUN code-server --install-extension ms-azuretools.vscode-docker
39+
#RUN code-server --install-extension ms-python.vscode-pylance
40+
#RUN code-server --install-extension ms-toolsai.jupyter
41+
RUN code-server --install-extension dongli.python-preview
42+
RUN code-server --install-extension njpwerner.autodocstring
43+
RUN code-server --install-extension bierner.markdown-emoji
44+
45+
3146
#ADD vscode-settings.json /home/coder/.local/share/code-server/User/settings.json
3247

48+
49+
50+
# INSTALL MINICONDA -------------------------------
51+
52+
RUN wget \
53+
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
54+
#RUN sudo mkdir -p /home/coder/local/bin/conda
55+
56+
RUN sudo bash Miniconda3-latest-Linux-x86_64.sh -b -p /home/coder/local/bin/conda
57+
RUN rm -f Miniconda3-latest-Linux-x86_64.sh
58+
RUN sudo useradd -s /bin/bash miniconda
59+
60+
RUN sudo chown -R miniconda:miniconda /home/coder/local/bin/conda \
61+
&& sudo chmod -R go-w /home/coder/local/bin/conda
62+
63+
64+
RUN sudo ln -s /home/coder/local/bin/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
65+
66+
ENV PATH="/home/coder/local/bin/conda/bin:${PATH}"
67+
RUN conda --version
68+
69+
# Create the environment:
70+
COPY environment.yml .
71+
RUN conda env create -f environment.yml -n basesspcloud
72+
73+
74+
# MAKE SURE THE basesspcloud CONDAENV IS USED ----------------
75+
76+
ENV CONDA_DEFAULT_ENV="basesspcloud"
77+
78+
3379
RUN echo "alias pip=pip3" >> ~/.bashrc
3480
RUN echo "alias python=python3" >> ~/.bashrc
81+
82+
#RUN echo "conda activate basesspcloud" >> ~/.bashrc
83+
RUN echo "{\"workbench.colorTheme\": \"Default Dark+\", \"python.pythonPath\": \"/home/coder/.conda/envs/basesspcloud/bin\"}" >> /home/coder/.local/share/code-server/User/settings.json
84+
85+
# Nice colors in python terminal
86+
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
87+
88+
ENV PATH="/home/coder/.conda/envs/basesspcloud/bin:$PATH"

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,21 @@ If you need a package, e.g. `flask`, open a terminal and run
2121
pip install flask
2222
```
2323

24+
Everything is integrated within a `conda` environment. You can also use
25+
26+
```shell
27+
conda install flask
28+
```
29+
30+
in a terminal if you prefer.
31+
32+
You can also edit a `Jupyter Notebook` (extension `.ipynb`) file. The Jupyter
33+
extension as well as additional useful extensions (`Git Lens` among others)
34+
is available.
35+
2436
Please visit https://github.com/cdr/code-server to learn how to use this image.
2537

38+
2639
# How to contribute
2740
If you find something is missing for general python programming with this image, don't hesitate to let us know, either with an issue or by submitting a PR.
2841

environment.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: basesspcloud
2+
3+
channels:
4+
- conda-forge
5+
6+
dependencies:
7+
- python
8+
- numpy
9+
- pandas
10+
- seaborn
11+
- scikit-learn
12+
- xgboost
13+
- pylint
14+
- boto3
15+
- s3fs
16+
- pip:
17+
- fasttext
18+
- pyyaml
19+
- xlrd
20+
- jupyter

0 commit comments

Comments
 (0)