Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear-up the notes about app migration #378

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions a-to-z.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ Use the following terms to refer to specific types of app:
* R Shiny app
* static web app

## Concourse

Upper case.

## conda

Lower case.
Expand Down
37 changes: 9 additions & 28 deletions source/documentation/apps/rshiny-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,10 @@ It is not currently possible to deploy new apps on the Analytical Platform, thou

### Existing apps

#### Your post-migration app and you

As part of the migration path from the Analytical Platform's hosting to the Cloud Platform there are some changes to how environments work.
Previously, only applications whose owners had specifically created a separate dev environment had a means of testing deployments before production.
Post-migration, all applications will have a live-like development environment, complete with continuous integration.
This section provides an overview of that new setup.

##### Overview

Your new environment is made up of two key elements:
Your app environment is made up of two key elements:

- A GitHub workflow
- A Cloud Platform namespace
Expand All @@ -45,7 +39,7 @@ In brief, the workflow builds and deploys your code as a docker container, and t

The flow looks something like this:

![High level visual overview of post-migration apps' deployment pipeline using GitHub Actions](images/apps/overview.svg)
![High level visual overview of apps' deployment pipeline using GitHub Actions](images/apps/overview.svg)

The rationale behind this change is to:

Expand Down Expand Up @@ -80,9 +74,7 @@ You can view the status of your deployments either by checking the workflow runs
The above describes how CI/CD will be set up by default in the ministryofjustice repo.
Once you have ownership of the repo, you'll have the ownership of the `.github/workflow/` files too so you will be able to amend the processes and triggers so that they meet your needs.

##### Your new deployment pipeline

Concourse was decomissioned in 2022: its replacement is GitHub's CI system, GitHub Actions.
##### Your app deployment pipeline

GitHub Actions has workflow definitions located in your repository under `.github/workflows/`.

Expand All @@ -98,11 +90,6 @@ Its steps are:

The production workflow behaves in the exact same way, containing the same steps, but will be triggered when a Pull Request is _merged_ into `main`, and will deploy to the production namespace instead

##### Pre-migration urgent redeployment

If you have an existing app that requires urgent redeployment, please [submit a request via GitHub issues](https://github.com/moj-analytical-services/analytical-platform-applications/issues/new?assignees=EO510%2C+YvanMOJdigital&labels=redeploy&template=redeploy-app-request.md&title=%5BREDEPLOY%5D).
We normally redeploy apps each Wednesday, where we have recevied a request by the Friday before.

## Managing published apps

### Manage app users
Expand Down Expand Up @@ -137,18 +124,6 @@ Your deployed app can be accessed at two URLs:

By default, the user list on `dev` empty and you will need to add any users requiring access via control panel.

#### Pre-migration apps

Your deployed app can be accessed at `repository-name.apps.alpha.mojanalytics.xyz`, where `repository-name` is the name of the relevant GitHub repository.

If the repository name contains underscores, these will be converted to dashes in the app URL. For example, an app with a repository called `repository_name` would have the URL `repository-name.apps.alpha.mojanalytics.xyz`.

#### Authenticating to your pre-migration apps

When accessing an app, you can choose whether to sign in using an email link (default) or a one-time passcode.
To sign in with a one-time passcode, add `/login?method=code` to the end of the app's URL, for example, `https://kpi-s3-proxy.apps.alpha.mojanalytics.xyz/login?method=code`.
This requires the app to have been deployed since the [auth-proxy release on 30th Jan 2019](https://github.com/ministryofjustice/analytics-platform-auth-proxy/releases/tag/v0.1.8).


#### Authenticating to your app

Expand Down Expand Up @@ -265,6 +240,12 @@ shows the code in context.
"guardian_authenticators": []
}
```
##### user-profile caching

Due to the [auth0 rate limit](https://auth0.com/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy/authentication-api-endpoint-rate-limits#limits-for-production-tenants-of-paying-customers) for `/userinfo`, the user-profile will be
cached for 10 minutes on auth-proxy, if somehow your app receives an exception, for example, token-expired, from the above call, you can add `/userinfo?force=true`
ymao2 marked this conversation as resolved.
Show resolved Hide resolved
to refresh the user-profle by force,
ymao2 marked this conversation as resolved.
Show resolved Hide resolved


## Troubleshooting and monitoring

Expand Down
10 changes: 7 additions & 3 deletions source/documentation/apps/static-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

It is not currently possible to deploy new apps on the Analytical Platform, though we are working to make this functionality available again as soon as possible.

In the meantime, you can still [access](#access-the-app) and [manage](#manage-app-users) existing apps. If you wish to update the content of an [S3 proxy app](https://github.com/moj-analytical-services/s3-proxy-webapp-template), you can still do so by making updates to your files in S3.
In the meantime, you can still [access](#access-the-app) and [manage](#manage-app-users) existing apps.

If you have an existing app that requires urgent redeployment, please submit a [request](https://github.com/moj-analytical-services/analytical-platform-applications/issues/new?assignees=EO510%2C+YvanMOJdigital&labels=redeploy&template=redeploy-app-request.md&title=%5BREDEPLOY%5D) via GitHub. We normally redeploy apps each Wednesday, where we have recevied a request by the Friday before.

Expand All @@ -14,9 +14,13 @@ To grant access to someone, in the [Control Panel wepapps tab](https://controlpa

## Access the app

The URL for the app will be the `respository-name` followed by `apps.alpha.mojanalytics.xyz`.
The URL for the app will be
- dev deployment environment: the `respository-name` followed by `apps.live.cloud-platform.service.justice.gov.uk`.
- prod deployment environment: `<respository-name>-dev` followed by `apps.live.cloud-platform.service.justice.gov.uk`.
ymao2 marked this conversation as resolved.
Show resolved Hide resolved

So for the example project above "static-web-deploy", the deployment URL will be `https://static-web-deploy.apps.alpha.mojanalytics.xyz`.
So for the example project above "static-web-deploy", the deployment URL will be
- dev: `https://static-web-deploy-dev.apps.live.cloud-platform.service.justice.gov.uk`
- prod: `https://static-web-deploy.apps.live.cloud-platform.service.justice.gov.uk`

Note that characters that are not compatible with website URLs are converted. So, repositories with underscores in their name (e.g. `repository_name.apps...`) will be converted to dashes for the URL (e.g. `repository_name.apps...`).

Expand Down