Skip to content

Commit e5c3a07

Browse files
committed
add instructions to use a local package directory
1 parent afb36f0 commit e5c3a07

File tree

1 file changed

+34
-1
lines changed
  • docs/develop/python-plugins/setup

1 file changed

+34
-1
lines changed

docs/develop/python-plugins/setup/index.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ This section describes which backend components are needed on the DataIntegratio
7474
### Package Index Locations
7575

7676
The basic setup allows for installation of packages from the [pypi.org](https://pypi.org/search/?q=%22cmem-plugin-%22) python package index, maintained by the [Python Software Foundation](https://www.python.org/psf-landing/).
77-
In order to change the index server, from where you can install python packages, you can use the following environment variables:
77+
In order to change the remote index server, from where you can install python packages, you need to set the following environment variables in the data integration container:
7878

7979
- `PIP_INDEX_URL` - Base URL of the default python package index Base URL. This should point to a repository which is compliant with [PEP 503 (the simple repository API)](https://peps.python.org/pep-0503/). If this variable is not set, the [official Python Package Index](https://pypi.python.org/simple) is used.
8080
- Example Value: `https://pypi.eccenca.com/simple` (the eccenca Python Package Index holds only published Corporate Memory Python Plugins and respective dependencies)
@@ -87,6 +87,39 @@ In order to change the index server, from where you can install python packages,
8787
For individual needs, you can use additional environment variables known by `pip` (`PIP_TRUSTED_HOST`, `PIP_CERT`, ...).
8888
Please have a look at the [pip documentation](https://pip.pypa.io/en/stable/topics/configuration/#environment-variables).
8989

90+
### Local Packages only
91+
92+
In cases, where you have limited or disabled network capabilities to the internet, you can disable package retrieval and provide the packages in a local directory.
93+
To do so, you need to set the following environment variables in the data integration container:
94+
95+
- `PIP_NO_INDEX` - set the value as `true` to disable the package retrieval completely.
96+
- `PIP_FIND_LINKS` - set to a container internal directory, where the packages and its dependencies will be provided.
97+
- Example Value: `/data/downloaded-packages`
98+
99+
This setup will allow installation of packages and its dependencies ONLY from the given directory.
100+
101+
As a next step, you need to provide the needed packages in this directory.
102+
To do so, use the [`pip download`](https://pip.pypa.io/en/stable/cli/pip_download/) command and copy or mount the downloaded files in your container.
103+
104+
??? note "Example shell session showing the usage of `pip download`"
105+
106+
```
107+
$ cat requirements.txt
108+
cmem-plugin-validation
109+
cmem-plugin-graphql
110+
cmem-plugin-kafka
111+
cmem-plugin-yaml
112+
113+
$ pip download --only-binary=:all: -r requirements.txt --platform manylinux2014_x86_64
114+
Collecting cmem-plugin-validation (from -r requirements.txt (line 1))
115+
...
116+
Saved ./six-1.16.0-py2.py3-none-any.whl
117+
Successfully downloaded cmem-plugin-validation ...
118+
```
119+
120+
Please note the `--platform` identifier. This is only needed in case you prepare the downloaded package directory
121+
on a machine with a different platform compared to you server (e.g. on a Mac).
122+
90123
### Package Path
91124

92125
The basic setup provides a `/data` directory inside of the DataIntegration container, where all changed files are managed in subdirectories.

0 commit comments

Comments
 (0)