Skip to content

Commit

Permalink
doc: update migration to 0.53.0 (#6613)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt committed Sep 4, 2023
1 parent c846597 commit be4da9b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 35 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ services:
echo '/!\\ Config file already exists';
fi;
chown -R cds:cds /app/conf /app/artifacts /app/repositories /app/cdn-buffer /app/cdn-storage;
/app/cds-engine-linux-amd64 config new > /app/conf/conf.toml;
mkdir -p /app/artifacts /app/repositories /app/hatchery-local;
chown -R cds:cds /app/conf /app/artifacts /app/repositories /app/hatchery-local /app/cdn-buffer /app/cdn-storage;
/app/cds-engine-linux-amd64 config edit /app/conf/conf.toml --output /app/conf/conf.toml api.artifact.local.baseDirectory=/app/artifacts;
Expand Down
83 changes: 49 additions & 34 deletions docs/content/hosting/upgrade/migrate_0.53.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,31 @@ weight: 1

Before upgrading your CDS Instance:
- You have to backup your databases: cds and cdn databases.
- You have to install the version 0.52.0
- You must follow the following step before upgrading to 0.53.0
- You have to install the version 0.52.0.
- You must follow the following step before upgrading to 0.53.0.


## Before upgrading

### Organization

The version 0.52.0 introduces the notion of Organization in CDS for all authentication drivers. In 0.53.0, organizations are mandatories so you need to add them before upgrading to 0.53.0
The version 0.52.0 introduced the notion of Organization in CDS for all authentication drivers. In 0.53.0, organizations are now mandatory so you need to add them before upgrading to 0.53.0.


* Upgrade you CDS API configuration to add organization on your different authentication drivers
* List all allowed organization in the field 'allowedOrganizations'
* Upgrade you CDS API configuration to add the following fields on your different authentication drivers.
* List all allowed organizations in the field 'allowedOrganizations'

```toml
[api.auth]
allowedOrganizations = ["my-organization"]

[api.auth.local]
enabled = true
organization = "my-organization"
signupDisabled = false


[api.auth.github]
organization = "my-organization"
apiUrl = "https://api.github.com"
clientId = "xxx"
clientSecret = "xxx"
enabled = true
signupDisabled = false
url = "https://github.com"

[api.auth.gitlab]
organization = "my-organization"
applicationID = "xxx"
enabled = true
secret = "xxx"
signupDisabled = false
url = "https://gitlab.com"

[api.auth.oidc]
organization = "my-organization"
[api.auth.corporateSSO] # There is no organization in SSO configuration, as it's provided by the SSO itself
[api.auth.ldap] # There is no organization in ldap configuration as it's provided by the company ldap field
```
Expand All @@ -73,16 +57,47 @@ cdsctl admin organization user-migrate my-organization

## Upgrading to 0.53.0

As we are updating DB table around authentication consumer, you will need to completely shutdown your CDS instances and all µservices.
This version contains changes on database table used to authenticate users, this will requires CDS to be stopped before the migration.

* Shutdown CDS and all µservices
* Shutdown all CDS's services.
* Apply the following changes to your CDS API configuration:
```
# The field enabled was renamed by signinEnabled in auth api.auth
[api.auth]
[api.auth.local]
signinEnabled = true
[api.auth.github]
signinEnabled = true
[api.auth.gitlab]
signinEnabled = true
[api.auth.oidc]
signinEnabled = true
[api.auth.corporateSSO]
signinEnabled = true
[api.auth.ldap]
signinEnabled = true
# The common configuration for auth drivers were moved to a new config section called drivers
[api.drivers]
[api.drivers.github]
url = ""
apiUrl = ""
clientId = ""
clientSecret = ""
[api.drivers.gitlab]
url = ""
applicationID = ""
secret = ""
[api.drivers.oidc]
...
[api.drivers.corporateSSO]
...
[api.drivers.ldap]
...
```
* Run the database migration, documentation on https://ovh.github.io/cds/hosting/database/
* Start 1 (scale to 1 if you usually use multiple instances) CDS API, check if there is no error on migration, with `cdsctl admin migration list`
* There are two migrations to check: 'OrganizationMigration' and 'ConsumerMigration'
* Migration can take a few minutes (between 1 and 5) depending on the number of users you have.
* Scale up CDS API if you usually use multiple instances
* Start other µservices




* Start CDS API service (scale to 1 instance if you usually use multiple instances).
* Login to CDS using the command line and check if there is no error on migration using `cdsctl admin migration list`.
* There are two migrations to check: 'OrganizationMigration' and 'ConsumerMigration'.
* Migration can take a few minutes depending on the number of users.
* Scale up CDS API if you usually use multiple instances then restart others services.

0 comments on commit be4da9b

Please sign in to comment.