Configure dependency registries
When you use external packages with your services, you might need to use a private registry. Itential Automation Gateway (IAG) supports PyPI and Ansible Galaxy registries for use with your Python and Ansible services.
Default registries
IAG provides default registries for both PyPI and Ansible Galaxy. The following table shows the basic details for these default registries, including the default registry name and the public repository that the registry points to.
If these registries don’t meet your needs, you can delete them and create a new default registry using the iagctl create registry command and specifying the --default flag. For more information, see iagctl create registry
Create a registry resource
You can also create a registry resource to specify information about private registries.
The following example creates a Python PyPI registry resource named my-pypi-registry:
This command uses the following parameters:
--urlspecifies the private repository (http://private-repo-hostname:8080/simple) that the registry points to.--usernamespecifiesadmin.--password-namereferences an IAG secret resource namedpip-password.
For more information about creating secrets, see iagctl create secret.
Now consider an example gateway-resources repository that contains a Python script with dependencies. IAG needs to fetch these dependencies from your private repository as specified in a requirements.txt file.
gateway-resources repository structure
You can create a Python script service as you normally would, but now specify the private registry my-pypi-registry that you created earlier:
When you execute the service, IAG uses the registry to fetch the dependencies listed in the requirements.txt file. You can verify this behavior by setting the configuration variable GATEWAY_LOG_LEVEL to DEBUG or lower:
If you don’t want secondary registries to override the default registry, set the GATEWAY_REGISTRY_DEFAULT_OVERRIDABLE configuration variable to false. For more information, see Registry variables