From 02cf5dcfffa64adef703439cab8e0ea4974f8885 Mon Sep 17 00:00:00 2001 From: Jamie MacDonald Date: Wed, 2 Aug 2023 13:32:33 +0100 Subject: [PATCH 1/4] Improve auth documentation --- .../installation/rasa-pro/installation.mdx | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/docs/docs/installation/rasa-pro/installation.mdx b/docs/docs/installation/rasa-pro/installation.mdx index afb86e5497d9..d8c069dba306 100644 --- a/docs/docs/installation/rasa-pro/installation.mdx +++ b/docs/docs/installation/rasa-pro/installation.mdx @@ -34,17 +34,37 @@ Installing Rasa Pro instead of Rasa Open Source will not break any existing scri ### Python Package Installation -The Rasa Pro python package is named `rasa-plus`. The `rasa-plus` python packages as well as the docker containers are hosted on our GCP artifact registry. +The Rasa Pro python package is named `rasa-plus`. The `rasa-plus` python packages as well as the Docker containers are hosted on our GCP Artifact Registry. As a prerequisite, you will need: -- to [install](https://cloud.google.com/sdk/docs/install) and [initialize](https://cloud.google.com/sdk/docs/initializing) the Google Cloud CLI. +- to [install](https://cloud.google.com/sdk/docs/install) the Google Cloud CLI. - to verify that the user or service account you are using has the required permissions to access the repository. #### Authentication Set-Up +These steps assume that you are using a GCP Service Account Key which Rasa has provided to you. + +Authenticate with GCP using the service account key. + +```sh +gcloud auth activate-service-account --key-file=service-account.json +``` + +Set up keyring to allow Pip to authenticate with GCP Artifact Registry by installing keyring and then the backend that supports GCP Artifact Registry + +```sh +pip install keyring +pip install keyrings.google-artifactregistry-auth +``` + +Verify that the backends have been installed correctly -In order for the package manager of choice (e.g, `pip` or `poetry`) to have the necessary credentials to authenticate with the registry, follow the steps in the [Google documentation](https://cloud.google.com/artifact-registry/docs/python/authentication#keyring). +```sh +keyring --list-backends +``` + +The results should include `ChainerBackend` and `GooglePythonAuth`. -Where required, input the following parameters: +Print the repository configuration to add to your Python project: ```sh gcloud artifacts print-settings python \ @@ -55,7 +75,11 @@ gcloud artifacts print-settings python \ #### Installing with `pip` -Enter the following settings to the `.pypirc` file: +Enter the following settings to the `.pypirc` file. This can be found: + +- Linux and MacOS: `$HOME/.pypirc` +- Windows: `%USERPROFILE%\.pypirc` + ``` [distutils] @@ -67,7 +91,19 @@ repository: https://europe-west3-python.pkg.dev/rasa-releases/rasa-plus-py/ ``` -Next, add these specific settings to the pip configuration file as instructed in the [GCP authentication documentation](https://cloud.google.com/artifact-registry/docs/python/authentication#keyring-setup): +Next, add these specific settings to the pip configuration file. The location for this depends on whether you want to update the per-user file or the file specific to a virtual environment that you are using. + +For the file associated with your operating system user: + +- Unix: `$HOME/.config/pip/pip.conf` or `$HOME/.pip/pip.conf` +- MacOS: `/Library/Application Support/pip/pip.conf` or `$HOME/.config/pip/pip.conf` +- Windows: `%APPDATA%\pip\pip.ini` or `%USERPROFILE%\pip\pip.ini` + +For virtual environments: + +- Unix and macOS: `$VIRTUAL_ENV/pip.conf` +- Windows: `%VIRTUAL_ENV%\pip.ini` + ``` [global] From dd9a27c432adb1a38e3c608bd2203a9867b2443a Mon Sep 17 00:00:00 2001 From: Jamie MacDonald Date: Wed, 2 Aug 2023 15:05:43 +0100 Subject: [PATCH 2/4] Correct Docker instructions --- docs/docs/installation/rasa-pro/installation.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/installation/rasa-pro/installation.mdx b/docs/docs/installation/rasa-pro/installation.mdx index d8c069dba306..96e72a7c3510 100644 --- a/docs/docs/installation/rasa-pro/installation.mdx +++ b/docs/docs/installation/rasa-pro/installation.mdx @@ -41,7 +41,7 @@ As a prerequisite, you will need: - to verify that the user or service account you are using has the required permissions to access the repository. #### Authentication Set-Up -These steps assume that you are using a GCP Service Account Key which Rasa has provided to you. +To authenticate you need use a service account key file provided by Rasa to authenticate with Google Cloud. Authenticate with GCP using the service account key. @@ -115,7 +115,7 @@ Finally, you should be able to run `pip install rasa-plus`. #### Installing with `poetry` -To install `rasa-plus` with `poetry`, you will need to associate the artifact registry URL with `rasa-plus` before installing it. +To install `rasa-plus` with `poetry`, you will need to associate the Artifact Registry URL with `rasa-plus` before installing it. Note that you must upgrade poetry to the latest minor (`1.2.0`) in order for `poetry` to work with the GCP authentication set-up. Proceed with the following steps: @@ -136,17 +136,17 @@ secondary = true ### Docker Image Installation -The Rasa Pro docker image is named `rasa-plus`. The docker images are hosted on our GCP artifact registry. +The Rasa Pro Docker image is named `rasa-plus`. The Docker images are hosted on our GCP Artifact Registry. As a prerequisite, you will need: -- to [install](https://cloud.google.com/sdk/docs/install) and [initialize](https://cloud.google.com/sdk/docs/initializing) the Google Cloud CLI. +- to [install](https://cloud.google.com/sdk/docs/install) the Google Cloud CLI. - to verify that the user or service account you are using has the required permissions to access the repository. -To be able to pull the docker image you need use a key file provided by Rasa to authenticate with google cloud. +To authenticate you need use a service account key file provided by Rasa to authenticate with Google Cloud. ```bash gcloud auth activate-service-account --key-file=${KEYFILE} -gcloud auth list +gcloud auth configure-docker europe-west3-docker.pkg.dev docker pull europe-west3-docker.pkg.dev/rasa-releases/rasa-plus/rasa-plus ``` From 625fab3ba3c19dc070e8ea07c9844f9cb66d99e2 Mon Sep 17 00:00:00 2001 From: Jamie MacDonald Date: Fri, 11 Aug 2023 12:03:40 +0100 Subject: [PATCH 3/4] Resolve typos and remove unnecessary command --- docs/docs/installation/rasa-pro/installation.mdx | 12 ++---------- .../installation/rasa-pro/rasa-pro-artifacts.mdx | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/docs/docs/installation/rasa-pro/installation.mdx b/docs/docs/installation/rasa-pro/installation.mdx index 96e72a7c3510..de276db3263b 100644 --- a/docs/docs/installation/rasa-pro/installation.mdx +++ b/docs/docs/installation/rasa-pro/installation.mdx @@ -64,14 +64,6 @@ keyring --list-backends The results should include `ChainerBackend` and `GooglePythonAuth`. -Print the repository configuration to add to your Python project: - -```sh -gcloud artifacts print-settings python \ - --project=rasa-releases \ - --repository=rasa-plus-py \ - --location=europe-west3 -``` #### Installing with `pip` @@ -95,13 +87,13 @@ Next, add these specific settings to the pip configuration file. The location fo For the file associated with your operating system user: -- Unix: `$HOME/.config/pip/pip.conf` or `$HOME/.pip/pip.conf` +- Linux: `$HOME/.config/pip/pip.conf` or `$HOME/.pip/pip.conf` - MacOS: `/Library/Application Support/pip/pip.conf` or `$HOME/.config/pip/pip.conf` - Windows: `%APPDATA%\pip\pip.ini` or `%USERPROFILE%\pip\pip.ini` For virtual environments: -- Unix and macOS: `$VIRTUAL_ENV/pip.conf` +- Linux and macOS: `$VIRTUAL_ENV/pip.conf` - Windows: `%VIRTUAL_ENV%\pip.ini` diff --git a/docs/docs/installation/rasa-pro/rasa-pro-artifacts.mdx b/docs/docs/installation/rasa-pro/rasa-pro-artifacts.mdx index af779bd4c076..51618122f1f0 100644 --- a/docs/docs/installation/rasa-pro/rasa-pro-artifacts.mdx +++ b/docs/docs/installation/rasa-pro/rasa-pro-artifacts.mdx @@ -12,7 +12,7 @@ import RasaProBanner from "@theme/RasaProBanner"; -- **Rasa Pro**, a drop-in replacement for Rasa Open Source enterprise +- **Rasa Pro**, a drop-in replacement for Rasa Open Source - **Rasa Pro Services**, flexible infrastructure and APIs on top of Rasa Open Source. Rasa Pro Services should be deployed alongside, but separately from your production assistant. From d1a93605055b66e1bcfafef75755de0dc3f1c631 Mon Sep 17 00:00:00 2001 From: Jamie MacDonald Date: Fri, 11 Aug 2023 12:23:32 +0100 Subject: [PATCH 4/4] Add section for intermediate repos --- .../installation/rasa-pro/installation.mdx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/docs/installation/rasa-pro/installation.mdx b/docs/docs/installation/rasa-pro/installation.mdx index de276db3263b..34df14d6a966 100644 --- a/docs/docs/installation/rasa-pro/installation.mdx +++ b/docs/docs/installation/rasa-pro/installation.mdx @@ -142,6 +142,26 @@ gcloud auth configure-docker europe-west3-docker.pkg.dev docker pull europe-west3-docker.pkg.dev/rasa-releases/rasa-plus/rasa-plus ``` +### Using An Intermediate Repository +If you are using your own intermediate repository to cache libraries or dependencies (such as Artifactory or Nexus Repository Manager), you may need to generate a set of static credentials that allow you to authenticate with GCP Artifact Registry. + +As a prerequisite, you will need: + +- to [install](https://cloud.google.com/sdk/docs/install) the Google Cloud CLI. +- to verify that the user or service account you are using has the required permissions to access the repository. + +To generate your credentials, run: + +```sh +gcloud artifacts print-settings python \ + --project=rasa-releases \ + --repository=rasa-plus-py \ + --location=europe-west3 \ + --json-key=service-account.json +``` + +Your credentials can be found in the output. The username will be `_json_key_base64` and the password will be a long, base64 encoded string. + ### Runtime Configuration Rasa Pro will look for your license in the env var `RASA_PRO_LICENSE`.