Skip to content

Commit

Permalink
Runtime software versioning data (#324)
Browse files Browse the repository at this point in the history
This PR adds a simple way to **manage available versions of software or
runtime** deployed on Clever Cloud.

Yaml files are used to render the list of a runtime or add-on.

-----
Co-authored-by: Julia <julia.navarro@clever-cloud.com>
  • Loading branch information
cnivolle authored Aug 16, 2024
1 parent 446315c commit a2d09a4
Show file tree
Hide file tree
Showing 20 changed files with 226 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/review-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Create review app
- name: Manage review app
uses: CleverCloud/clever-cloud-review-app@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion content/doc/addons/elastic/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Provisioning the Elastic Stack addon on Clever Cloud will give you an Elasticsea

## Versions

The current versions supported at add-on creation are 7 and 8.
The current versions supported at add-on creation are the following:
{{< software_versions_shared_dedicated elasticsearch>}}

## Elasticsearch

Expand Down
6 changes: 3 additions & 3 deletions content/doc/addons/mongodb/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ aliases:
- /doc/deploy/addon/mongodb/managing-mongodb
type: docs
---
## Overview

MongoDB is an open source NoSQL document-oriented database. We provide these databases with daily backups and monitoring for both shared and dedicated plans.

## Versions
## Supported Versions

In order to comply with [MongoDB Server Side Public License](https://www.mongodb.com/licensing/server-side-public-license), the version currently installed by the add-on is:

- on shared plans (DEV) : MongoDB 4.0.3
- on newly created dedicated databases (plans XS Small Space and above) : MongoDB 4.0.3
{{< software_versions_shared_dedicated mongo>}}

### Higher Versions

Expand Down
9 changes: 3 additions & 6 deletions content/doc/addons/mysql/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ aliases:
- /doc/deploy/addon/mysql/mysql
type: docs
---

## Overview
MySQL is an open-source relational database management system (RDBMS).

## Versions

The version currently installed by the add-on is :
## Supported Versions

- on shared plans (DEV) : MySQL 8.0
- on newly created dedicated databases (plans XS Small Space and above) : MySQL 5.7.20 or 8.0
{{< software_versions_shared_dedicated mysql>}}

{{% content/db-backup %}}

Expand Down
7 changes: 3 additions & 4 deletions content/doc/addons/postgresql/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ aliases:

type: docs
---
## Overview

PostgreSQL is an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.

## Versions
## Supported Versions

Versions currently available for order are as follows:
- On shared (DEV) cluster: PostgreSQL version 15
- On dedicated plans: PostgreSQL versions 10, 11, 12, 13, 14 and 15
{{< software_versions_shared_dedicated pg>}}

{{% content/db-backup %}}

Expand Down
4 changes: 3 additions & 1 deletion content/doc/addons/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Redis is an open source, in-memory data structure store, used as database, cache

## Version

The version currently installed by the add-on is : Redis 7.2.4
The version currently installed by the add-on are the following :

{{< software_versions_shared_dedicated elasticsearch>}}

{{% content/db-backup %}}

Expand Down
6 changes: 5 additions & 1 deletion content/doc/applications/dotnet/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ You don't need to change a lot in your application, the *requirements* section e

### .NET version

The default version used on Clever Cloud is `8.0`. You can change it by setting the `CC_DOTNET_VERSION` environment variable to `6.0`. Clever Cloud doesn't support non-LTS and older versions.
The versions used on Clever Cloud are the following:

{{< runtimes_versions dotnet >}}

You can change the default version by setting the `CC_DOTNET_VERSION` environment variable to `6.0`. Clever Cloud doesn't support non-LTS and older versions.

### Requirements

Expand Down
4 changes: 3 additions & 1 deletion content/doc/applications/elixir/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ Clever Cloud supports Elixir based applications.

### Mandatory configuration

- Get your Elixir version in your console with `$ elixir -v` and set the environment variable **CC_ELIXIR_VERSION** to its value (available versions as of today are `1.8`, `1.9`, `1.10`, `1.11`, `1.12`, `1.13`, `1.14`, `1.15` or `1.16`).
Get your Elixir version in your console with `$ elixir -v` and set the environment variable `CC_ELIXIR_VERSION` to its value. Available versions as of today are the following:

{{< runtimes_versions elixir >}}

#### Compatibility between Elixir and Erlang/OTP

Expand Down
6 changes: 6 additions & 0 deletions content/doc/applications/java/java-gradle.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Note : like other runtimes, Java application need listen on `0.0.0.0:8080`

{{% content/java-versions %}}

Accepted values are the following:

{{< runtimes_versions java >}}

(`graalvm-ce` for GraalVM 21.0.0.2, based on OpenJDK 11.0)

## Configure your Java application

You *must* provide a `clevercloud/gradle.json` file (gradle.json file in
Expand Down
4 changes: 4 additions & 0 deletions content/doc/applications/java/java-jar.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Note : like other runtimes, Java application needs to listen on `0.0.0.0:8080`

{{% content/java-versions %}}

{{< runtimes_versions java >}}

(`graalvm-ce` for GraalVM 21.0.0.2, based on OpenJDK 11.0)

## Configure your Java application

You *must* either have the `CC_JAR_PATH` environment variable containing the
Expand Down
4 changes: 4 additions & 0 deletions content/doc/applications/java/java-maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Your application must be set to listen on the port 8080.

{{% content/java-versions %}}

{{< runtimes_versions java >}}

(`graalvm-ce` for GraalVM 21.0.0.2, based on OpenJDK 11.0)

### Mandatory configuration

#### Option 1: JSON file in repository
Expand Down
4 changes: 4 additions & 0 deletions content/doc/applications/java/java-war.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ The supported containers are listed below:

{{% content/java-versions %}}

{{< runtimes_versions java >}}

(`graalvm-ce` for GraalVM 21.0.0.2, based on OpenJDK 11.0)

## Configure your Java application

{{< callout type="warning" >}}
Expand Down
2 changes: 2 additions & 0 deletions content/doc/applications/javascript/nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Be sure that:

You can use the `engines.node` field in `package.json` to define the wanted version, if not provided we will use the latest LTS version available on Clever Cloud.

{{< runtimes_versions node >}}

### About package.json

The `package.json` file should look like the following:
Expand Down
15 changes: 3 additions & 12 deletions content/doc/applications/php/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ aliases:
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded
into HTML.

PHP is available on our platform with the branches 5.6, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2 and 8.3. You can use FTP or Git to deploy your applications.

The HTTP server is [Apache 2](https://httpd.apache.org/), and the PHP code is executed by [PHP-FPM](https://php-fpm.org/).

{{% content/create-application %}}
Expand All @@ -32,18 +30,11 @@ The HTTP server is [Apache 2](https://httpd.apache.org/), and the PHP code is ex

### Choose your PHP version

Set the `CC_PHP_VERSION` environment variable to one of the following values:
Set the `CC_PHP_VERSION` environment variable to one of the following versions.

- `5.6`
- `7.2`
- `7.3`
- `7.4`
- `8.0`
- `8.1`
- `8.2`
- `8.3`
{{< runtimes_versions PHP >}}

All new PHP applications are created with a default `CC_PHP_VERSION`, set to `8.3`. You can of course change it whenever you want then redeploy your application to use the version you want. We only support values based on the first two digits (`X` or `X.Y`, not `X.Y.Z`).
All new PHP applications are created with a default `CC_PHP_VERSION`. You can of course change it whenever you want then redeploy your application to use the version you want. We only support values based on the first two digits (`X` or `X.Y`, not `X.Y.Z`).

The configuration file for your PHP application must be `/clevercloud/php.json`, that is a *php.json* file in a `/clevercloud` folder at the root of your application.

Expand Down
4 changes: 3 additions & 1 deletion content/doc/applications/python/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ comments: false

Python is a programming language that lets you work more quickly and integrate your systems more efficiently.

Python 2.7, 3.7, 3.8, 3.9, 3.10 and 3.11 are available on Clever Cloud. You can use Git to deploy your application.
### Supported Versions

{{< runtimes_versions python >}}

{{% content/create-application %}}

Expand Down
53 changes: 53 additions & 0 deletions data/runtime_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
node:
default:
- "v20.15.0"
PHP:
default:
- "8.3"
accepted:
- "5.6"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
python:
default:
- "3.12.4"
accepted:
- "2.7"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
dotnet:
default:
- "6.0"
accepted:
- "8.0"
elixir:
default:
- "1.16"
accepted:
- "1.8"
- "1.9"
- "1.10"
- "1.11"
- "1.12"
- "1.13"
- "1.14"
- "1.15"
java:
default:
- "11"
accepted:
- "22"
- "21"
- "17"
- "11"
- "8"
- "7"
- "graalvm-ce"
36 changes: 36 additions & 0 deletions data/software_versions_shared_dedicated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Example usage:
#myDB
# shared:
# - version_1
# - version_2
# dedicated:
# - version_1
# - version_1
# - version_2
pg:
dedicated:
- "v11.22"
- "v12.19"
- "v13.15"
- "v14.12"
- "v15.7"
dev:
- "v15"
mysql:
dedicated:
- "v5.7.20"
- "v8.0.36"
dev:
- "v8.0"
mongo:
dedicated:
- "v4.0.3"
dev:
- "v4.0.3"
elasticsearch:
dedicated:
- "v7.17.10"
- "v8.10.2"
redis:
dedicated:
- "v7.2.4"
7 changes: 1 addition & 6 deletions layouts/shortcodes/content/java-versions.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
## Available Java versions

Simply set the environment variable **CC_JAVA_VERSION** to the version you want.


⚠️ Clever Cloud uses Java version 11 by default. New applications have the `CC_JAVA_VERSION` environment variable set to **21**.

Accepted values are `7`, `8`, `11`, `17`, `21`, `22` or `graalvm-ce` (for GraalVM 21.0.0.2, based on OpenJDK 11.0).
Set the environment variable `CC_JAVA_VERSION` to the version you want.

We follow the official Java [roadmap](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) by supporting both LTS and latest non-LTS versions.

Expand Down
49 changes: 49 additions & 0 deletions layouts/shortcodes/runtimes_versions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{{ $software := or (.Get 0) }}
{{ $version_list := .Site.Data.runtime_versions }}

{{ with index $version_list $software }}
{{ $default := .default | default (slice) }}
{{ $accepted := .accepted | default (slice) }}
{{ $default_len := len $default }}
{{ $accepted_len := len $accepted }}
{{ $max_len := $default_len }}
{{ if gt $accepted_len $default_len }}
{{ $max_len = $accepted_len }}
{{ end }}

<table>
<thead>
<tr>
{{ if $default_len }}
<th>Default Version</th>
{{ end }}
{{ if $accepted_len }}
<th>Accepted Versions</th>
{{ end }}
</tr>
</thead>
<tbody>
{{ range $i := seq 0 (sub $max_len 1) }}
<tr>
{{ if $default_len }}
<td>
{{ with index $default $i }}
<code>{{ . }}</code>
{{ else }}
{{ end }}
</td>
{{ end }}
{{ if $accepted_len }}
<td>
{{ with index $accepted $i }}
<code>{{ . }}</code>
{{ else }}
<code></code>
{{ end }}
</td>
{{ end }}
</tr>
{{ end }}
</tbody>
</table>
{{ end }}
38 changes: 38 additions & 0 deletions layouts/shortcodes/software_versions_shared_dedicated.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{ $software := or (.Get 0) }}
{{ $version_list := .Site.Data.software_versions_shared_dedicated }}
{{ $software_versions := index $version_list $software }}
{{ $has_dev := false }}

{{ if $software_versions.dev }}
{{ $has_dev = true }}
{{ end }}
<table>
<thead>
<tr>
<th>Dedicated</th>
{{ if $has_dev }}
<th>Dev</th>
{{ end }}
</tr>
</thead>
<tbody>
{{ range $index, $dedicated_version := $software_versions.dedicated }}
<tr>
<td><code>{{ $dedicated_version }}</code></td>
{{ if $has_dev }}
<td>
{{ with index $software_versions.dev $index }}
<code>{{ . }}</code>
{{ else }}
<!-- If the index is outside the dev values -->
{{ end }}
</td>
{{ end }}
</tr>
{{ end }}
</tbody>
</table>
{{ if $has_dev }}
{{ $.Page.RenderString "<!-- markdown -->{{< callout type=\"warning\">}} <strong>Important</strong>: Dev plans are free and intended <u>solely for testing purposes</u>. They don't provide the same guarantees or SLAs as dedicated plans. {{< /callout >}}" | safeHTML }}
{{ end }}

0 comments on commit a2d09a4

Please sign in to comment.