Skip to content

Commit ecba636

Browse files
authored
Merge pull request #341 from MAAP-Project/package-installs-update
Package installs update
2 parents 92b0c21 + 2bd647b commit ecba636

File tree

5 files changed

+31
-24
lines changed

5 files changed

+31
-24
lines changed
400 KB
Loading
-118 KB
Binary file not shown.

docs/source/getting_started/writing_code.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"cell_type": "markdown",
5454
"metadata": {},
5555
"source": [
56-
"### Clone a Respository with GitHub\n",
56+
"### Clone a Repository with GitHub\n",
5757
"\n",
5858
"Any git repository online can be used to host code. Here is an example algorithm you can use for this getting started guide:\n",
5959
"https://github.com/MAAP-Project/dps-unit-test\n",
@@ -84,7 +84,7 @@
8484
"1. Make a new folder for your test algorithm. Open a terminal here (File > New > Terminal or use the blue \"+\" button above the Jupyter file browser).\n",
8585
"![New Folder](_static/clone_demo1.png)\n",
8686
"\n",
87-
"2. Follow the steps [above](#Clone-a-Respository-with-GitHub) for how to Clone a Respository with GitHub"
87+
"2. Follow the steps [above](#Clone-a-Repository-with-GitHub) for how to Clone a Repository with GitHub"
8888
]
8989
},
9090
{
@@ -225,9 +225,9 @@
225225
"source": [
226226
"## Customizing your workspace environment\n",
227227
"\n",
228-
"Your Jupyter workspace has a set of pre-installed libraries, depending on [which Stack you selected](getting_started.ipynb#Creating-a-workspace). If you need libraries that are not pre-installed, we suggest using an environment manager; `mamba` is pre-installed to help with this. \n",
228+
"Your Jupyter workspace has a set of pre-installed libraries, depending on [which Stack you selected](getting_started.ipynb#Creating-a-workspace). If you need libraries that are not pre-installed, we suggest using an environment manager; `conda` is pre-installed to help with this. \n",
229229
"\n",
230-
"Full [documentation on configuring mamba](../system_reference_guide/custom-environments.ipynb) (or conda) may be found in the [System Reference Guide](../system_reference.rst).\n"
230+
"Full [documentation on configuring conda](../system_reference_guide/custom-environments.ipynb) may be found in the [System Reference Guide](../system_reference.rst).\n"
231231
]
232232
},
233233
{

docs/source/system_reference_guide/custom-environments.ipynb

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,33 @@
3838
"\n",
3939
"### Package manager\n",
4040
"\n",
41-
"We use `mamba` (a fast `conda` drop-in replacement) as a package manager to install, update or remove packages (libraries). `mamba` works with 'environments' that are directories in your local file system containing a set of packages. When you work 'in a given environment', it means that your programs will look for dependencies in that environment's `mamba` directory. All workspaces launch with an environment called `base`, which is a `mamba` environment that has all the pre-installed libraries. If you open a terminal launcher after creating a `Basic Stable` workspace : \n",
41+
"We use `conda` with the libmamba solver as a package manager to install, update or remove packages (libraries). `conda` works with 'environments' that are directories in your local file system containing a set of packages. When you work 'in a given environment', it means that your programs will look for dependencies in that environment's `conda` directory. All workspaces launch with an environment called `base`, which is a `conda` environment that has all the pre-installed libraries. If you open a terminal launcher after creating a `Basic Stable` workspace : \n",
4242
"\n",
4343
"\n",
4444
"![Base conda environment location](../_static/base_conda_environment_location.png)\n",
4545
"\n",
46-
"You can notice that a `base` `mamba` environment is activated, and its libraries are located in `/opt/conda`. \n",
46+
"You can notice that a `base` `conda` environment is activated, and its libraries are located in `/opt/conda`. \n",
4747
"\n",
4848
"### Extending the `base` environment in a given workspace session.\n",
4949
"\n",
5050
"**Note : any modification to the `base` environment does not survive a workspace restart. In other words, modifications to `/opt/conda` disappear after a workspace restart**. \n",
5151
"\n",
52-
"Extending an existing `mamba` environment means adding packages on top of what it contains, which works provided there are no dependency conflicts. You can install libraries using the `mamba install` command to install additional packages in your current environment (run `mamba --help` to learn more about how to use `mamba` commands). For example :\n",
52+
"Extending an existing `conda` environment means adding packages on top of what it contains, which works provided there are no dependency conflicts. You can install libraries using the `conda install` command to install additional packages in your current environment (run `conda --help` to learn more about how to use `conda` commands). All `conda` install commands should use `-c conda-forge` otherwise it's unlikely to work, since many/most of the packages installed already are from conda-forge. For example :\n",
5353
"\n",
5454
"```\n",
55-
"mamba install xarray\n",
55+
"conda install -c conda-forge xarray\n",
56+
"```\n",
57+
"\n",
58+
"libmamba is the default solver, but users are welcome to set the solver to \"classic\" with: \n",
59+
"\n",
60+
"```\n",
61+
"conda install --solver=classic -c conda-forge xarray\n",
5662
"```\n",
5763
"\n",
5864
"However, it is recommended to use configuration files for reproducibility and shareability. With this approach, assuming your configuration file is named `config.yml`, the command to use is : \n",
5965
"\n",
6066
"```\n",
61-
"mamba env update -f config.yml\n",
67+
"conda env update -f config.yml\n",
6268
"```\n",
6369
"\n",
6470
"For more details on configuration files, see the [Custom environments section](#Custom-environments) and for an example of this command, refer to the [subsection about updating an environment with a configuration file](#Updating-an-existing-environment-with-a-configuration-file).\n"
@@ -73,7 +79,7 @@
7379
"\n",
7480
"*For the rest of this README, in each section we provide a link to download an example YAML configuration file.*\n",
7581
"\n",
76-
"You can use the `mamba` CLI to create a new, custom environment. The parameters (the list of libraries, the location where to search for them, etc...) can be passed either from a configuration YAML file or directly on the console. We recommend using the first option (a YAML file is easier to share and modify). \n",
82+
"You can use the `conda` CLI to create a new, custom environment. The parameters (the list of libraries, the location where to search for them, etc...) can be passed either from a configuration YAML file or directly on the console. We recommend using the first option (a YAML file is easier to share and modify). \n",
7783
"\n",
7884
"### Basic custom environment\n",
7985
"\n",
@@ -82,39 +88,39 @@
8288
"This configuration installs specific versions `python`, `pandas` and `geopandas` from `conda-forge`. If versions aren't specified, the latest is installed. We recommend to always specify the version for reproducibility. The basic command to create this environment would be :\n",
8389
"\n",
8490
"```\n",
85-
"mamba env create -f env-example.yml\n",
91+
"conda env create -f env-example.yml\n",
8692
"```\n",
8793
"\n",
8894
"However, this stores this environment files in `/opt/conda`, which is a directory that is recreated when the workspace restarts, and so custom environments are lost. Therefore, you want to specify a storage location in your user directory with the `--prefix` parameter\n",
8995
"\n",
9096
"```\n",
91-
"mamba env create -f env-example.yml --prefix /projects/env\n",
97+
"conda env create -f env-example.yml --prefix /projects/env/env-example\n",
9298
"```\n",
9399
"\n",
94100
"and to activate it : \n",
95101
"\n",
96102
"```\n",
97-
"mamba activate env-example\n",
103+
"conda activate /projects/env/env-example\n",
98104
"```\n",
99105
"\n",
100106
"### Updating an existing environment with a configuration file\n",
101107
"\n",
102108
"*Example config file for this section [here](./example_conda_configuration_files/env-extend.yml).*\n",
103109
"\n",
104-
"You can *update* an existing environment with a configuration file as well. For example, let's assume you have a `mamba` environment with a set of packages already installed in it (for example the `base` environment), but it doesn't have `xarray` and `geopandas`. Using the linked example config : \n",
110+
"You can *update* an existing environment with a configuration file as well. For example, let's assume you have a `conda` environment with a set of packages already installed in it (for example the `base` environment), but it doesn't have `xarray` and `geopandas`. Using the linked example config : \n",
105111
"\n",
106112
"```\n",
107-
"mamba env update -f env-extend.yml\n",
113+
"conda env update -f env-extend.yml\n",
108114
"```\n",
109115
"\n",
110-
"This command will update `base` by adding `xarray` and `geopandas`, provided it does not cause conflicts with the existing libraries. \n",
116+
"This command will update the active environment by adding `xarray` and `geopandas`, provided it does not cause conflicts with the existing libraries. \n",
111117
"\n",
112118
"\n",
113119
"### Using `pip` for python packages\n",
114120
"\n",
115121
"*Example config file for this section [here](./example_conda_configuration_files/env-with-pip.yml).*\n",
116122
"\n",
117-
"Some python packages might not be availabe in the channel you are using, or in any `mamba` channel. If that package however is in `PyPI` (the official python package repository), one can use `pip` within a `mamba` environment to download packages. The recommended way is to specify this in the configuration file. In the linked example, we add `stackstac` as a dependency to install from `PyPI` because it is not available in the `conda-forge` channel. \n",
123+
"Some python packages might not be availabe in the channel you are using, or in any `conda` channel. If that package however is in `PyPI` (the official python package repository), one can use `pip` within a `conda` environment to download packages. The recommended way is to specify this in the configuration file. In the linked example, we add `stackstac` as a dependency to install from `PyPI` because it is not available in the `conda-forge` channel. \n",
118124
"\n",
119125
"### Using custom environments in jupyter notebooks\n",
120126
"\n",
@@ -126,23 +132,24 @@
126132
"- Create your environment using the linked configuration file.\n",
127133
"- Install the environment as a kernel by running the following command (parameter values follow the example mentioned):\n",
128134
" ```\n",
129-
" python -m ipykernel install --user --name env-with-ipykernel --display-name \"Python env-with-ipykernel\".\n",
135+
" python -m ipykernel install --user --name env-with-ipykernel --display-name \"Python env-with-ipykernel\"\n",
130136
" ```\n",
131137
" The above command installs the environment as a kernel in Jupyter, making it accessible in the notebook with a display name of \"Python env-with-ipykernel\".\n",
132138
"- Wait around 30 seconds and launch a new notebook. Among the kernel options, you should see \"Python env-with-ipykernel\" listed. Below you can see a screenshot that shows what this step looks like:\n",
133-
"![Register a kernel with a conda environment and launch a notebook with it](../_static/launch_registered_kernel_custom_conda.png)\n",
139+
"![Register a kernel with a conda environment and launch a notebook with it](../_static/launch_custom_kernel_conda.png)\n",
140+
"- Remove by listing kernelspecs `jupyter kernelspec list` to find name, then `jupyter kernelspec remove <env>`\n",
134141
"\n",
135142
"### Suggested packages for custom environment\n",
136143
"\n",
137144
"*Example config file for this section [here](./example_conda_configuration_files/env-with-maap-py.yml)*\n",
138145
"\n",
139-
"MAAP users typically use the python `maap-py`. It's pre-installed in all workspaces, in the `base` mamba environment, but any custom environment should specify it, otherwise it is not going to be accessible from that environment. However, `maap-py` is not packaged in a public package repository, like `PyPI` or `conda-forge`. It is possible to install it directly from its github repository with `pip` though. See the configuration example linked. You can note that in the example, `maap-py` is 'versioned' using a commit hash (at the end of the github URL). "
146+
"MAAP users typically use the python `maap-py`. It's pre-installed in all workspaces, in the `base` conda environment, but any custom environment should specify it, otherwise it is not going to be accessible from that environment. However, `maap-py` is not packaged in a public package repository, like `PyPI` or `conda-forge`. It is possible to install it directly from its github repository with `pip` though. See the configuration example linked. You can note that in the example, `maap-py` is 'versioned' using a commit hash (at the end of the github URL). "
140147
]
141148
}
142149
],
143150
"metadata": {
144151
"kernelspec": {
145-
"display_name": "Python 3",
152+
"display_name": "Python 3.11.1 64-bit",
146153
"language": "python",
147154
"name": "python3"
148155
},
@@ -156,7 +163,7 @@
156163
"name": "python",
157164
"nbconvert_exporter": "python",
158165
"pygments_lexer": "ipython3",
159-
"version": "3.10.10"
166+
"version": "3.11.1"
160167
},
161168
"metadata": {
162169
"interpreter": {
@@ -165,7 +172,7 @@
165172
},
166173
"vscode": {
167174
"interpreter": {
168-
"hash": "8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1"
175+
"hash": "5c7b89af1651d0b8571dde13640ecdccf7d5a6204171d6ab33e7c296e100e08a"
169176
}
170177
}
171178
},

docs/source/system_reference_guide/work_with_git.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metadata": {},
66
"source": [
77
"### Committing Changes to a Git Repository\n",
8-
"All projects imported from GitLab can be found in `/projects`. Instructions how to clone a repository from Git can be found [here](../getting_started/writing_code.html#Clone-a-Respository-with-GitHub) and instructions for working with MAAP GitLab can be found [here.](../getting_started/writing_code.html#Working-with-the-MAAP-GitLab)\n",
8+
"All projects imported from GitLab can be found in `/projects`. Instructions how to clone a repository from Git can be found [here](../getting_started/writing_code.html#Clone-a-Repository-with-GitHub) and instructions for working with MAAP GitLab can be found [here.](../getting_started/writing_code.html#Working-with-the-MAAP-GitLab)\n",
99
"\n",
1010
"Before you update your project with your changes, you need to get a classic personal access token from GitHub. MAAP currently doesn't supported fine-grained tokens. Create a classic personal access token by following [these steps](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) in Developer settings. Remember to save your personal access token for later use. \n",
1111
"\n",

0 commit comments

Comments
 (0)