Environment variables

Some arguments of the .init() function can be provided as environment variables. For some - like your API token - it's a more secure way. For some - like project name or custom run id - often it's more convenient.

NEPTUNE_API_TOKEN

The API token used for authentication. If api_token is not provided to the .init() function, value of NEPTUNE_API_TOKEN will be used. You can find your API token here.

Usage

Linux
Windows
macOS
Linux
export NEPTUNE_API_TOKEN='YOUR_LONG_API_TOKEN'
Windows
set NEPTUNE_API_TOKEN='YOUR_LONG_API_TOKEN'
macOS
export NEPTUNE_API_TOKEN='YOUR_LONG_API_TOKEN'

or append this line to your ~/.bashrc or ~/.bash_profile files (recommended).

Always keep your API token secret - it is like a password to the application. Appending the "export NEPTUNE_API_TOKEN=’YOUR_LONG_API_TOKEN" line to your ~/.bashrc or ~/.bash_profile file is the recommended method to ensure it remains secret.

NEPTUNE_PROJECT

The project in which new runs will be created. If project is not provided to the .init() function, value of NEPTUNE_PROJECT will be used.

Usage

Linux
Windows
macOS
Linux
export NEPTUNE_PROJECT='namespace/project_name'
Windows
set NEPTUNE_PROJECT='namespace/project_name'
macOS
export NEPTUNE_PROJECT='namespace/project_name'

NEPTUNE_CUSTOM_RUN_ID

A unique identifier that can be used to log metadata to a single run from multiple files or processes. If custom_run_id is not provided to the .init() function, value of NEPTUNE_CUSTOM_RUN_ID will be used.

The maximum length of the identifier is 32 characters. Make sure you are using the same identifier everywhere and to clear it once you want to log to a new run. See Pipelines guide.

Linux
Windows
macOS
Linux
export NEPTUNE_CUSTOM_RUN_ID='SOME RANDOM ID'
# or even better
export NEPTUNE_CUSTOM_RUN_ID=`date | md5`
Windows
set NEPTUNE_CUSTOM_RUN_ID='SOME RANDOM ID'
# or even better
set NEPTUNE_CUSTOM_RUN_ID=`date | md5`
macOS
export NEPTUNE_CUSTOM_RUN_ID='SOME RANDOM ID'
# or even better
export NEPTUNE_CUSTOM_RUN_ID=`date | md5`

NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE

In some infrastructure setups, you may encounter problems connecting to Neptune because of the SSL certificate configuration:

  • you are in a corporate network, behind a proxy that inspects traffic between your runs and Neptune SaaS

  • your on-prem installation's SSL/TLS certificate is not recognized by Python by default

Those problems typically show as SSLError or NeptuneConnectionLostException.

To solve it, you need to go to your console and set NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE to 'TRUE' :

Linux
Windows
macOS
Linux
export NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE='TRUE'
Windows
set NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE='TRUE'
macOS
export NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE='TRUE'

Important In Jupyter notebook environments using %env to set this variable can solve the problem.

%env NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE='TRUE'