Skip to content

Commit

Permalink
Add ARM support to install-instructions-test (#6795)
Browse files Browse the repository at this point in the history
* Add support for multi-arch testing

* Fix AmazonLinux ARM install instructions

* Add ability to set base URL for install instructions testing

* Specify ARCH when running tests

* Add per-arch build config

* Add ARM tests for all distros

* Fix RHEL install instructions

* Fix Ubuntu ARM instructions

* Fix Debian ARM instructions

* Additional debugging for RHEL images

* Gateway OSS does not have a 3.4.3 release yet

* Fix RHEL download.konghq.com

* Update Ubuntu install docs to use Jammy repo
  • Loading branch information
mheap committed Jan 23, 2024
1 parent d85b82f commit 2d9d9c4
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 62 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/install-instructions-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Install Instructions
on: workflow_dispatch
on:
workflow_dispatch:
inputs:
base_url:
type: string
description: URL to test against. Defaults to http://localhost:8888

jobs:
install-instructions:
Expand All @@ -9,19 +14,27 @@ jobs:
fail-fast: false
matrix:
distro: [ubuntu, rhel, amazon-linux, debian, centos]
arch: ["linux/amd64", "linux/arm64"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Run Install tests
env:
DISTRO: ${{ matrix.distro }}
ARCH: ${{ matrix.arch }}
CONTINUE_ON_ERROR: 1
IGNORE_SKIPS: 1
EXPECTED_FAILURES_EXIT_CODE: 0
BASE_URL: ${{ github.event.inputs.base_url || env.BASE_URL }}
run: |
cd tools/install-tester
npm ci
Expand Down
2 changes: 1 addition & 1 deletion app/_data/kong_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
lua_doc: true
- release: "3.4.x"
ee-version: "3.4.3.3"
ce-version: "3.4.3"
ce-version: "3.4.2"
edition: "gateway"
luarocks_version: "3.0.0-0"
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions app/_src/gateway/install/linux/amazon-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ Install {{site.base_gateway}} on Amazon Linux from the command line.
{% navtabs_ee codeblock %}
{% navtab Kong Gateway %}
```bash
curl -Lo kong-enterprise-edition-{{page.versions.ee}}.rpm $(rpm --eval {{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/rpm/amzn/%{amzn}/x86_64/kong-enterprise-edition-{{page.versions.ee}}.aws.x86_64.rpm)
curl -Lo kong-enterprise-edition-{{page.versions.ee}}.rpm $(rpm --eval {{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/rpm/amzn/%{amzn}/%{_arch}/kong-enterprise-edition-{{page.versions.ee}}.aws.%{_arch}.rpm)
```
{% endnavtab %}
{% navtab Kong Gateway (OSS) %}
```bash
curl -Lo kong-{{page.versions.ce}}.rpm $(rpm --eval {{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/rpm/amzn/%{amzn}/x86_64/kong-{{page.versions.ce}}.aws.x86_64.rpm)
curl -Lo kong-{{page.versions.ce}}.rpm $(rpm --eval {{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/rpm/amzn/%{amzn}/%{_arch}/kong-{{page.versions.ce}}.aws.%{_arch}.rpm)
```
{% endnavtab %}
{% endnavtabs_ee %}
Expand Down
8 changes: 4 additions & 4 deletions app/_src/gateway/install/linux/debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ Install {{site.base_gateway}} on Debian from the command line.
{% navtabs_ee codeblock %}
{% navtab Kong Gateway %}
```bash
curl -Lo kong-enterprise-edition-{{page.versions.ee}}.amd64.deb "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/deb/debian/pool/bullseye/main/k/ko/kong-enterprise-edition_{{page.versions.ee}}/kong-enterprise-edition_{{page.versions.ee}}_amd64.deb"
curl -Lo kong-enterprise-edition-{{page.versions.ee}}.deb "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/deb/debian/pool/bullseye/main/k/ko/kong-enterprise-edition_{{page.versions.ee}}/kong-enterprise-edition_{{page.versions.ee}}_$(dpkg --print-architecture).deb"
```
{% endnavtab %}
{% navtab Kong Gateway (OSS) %}
```bash
curl -Lo kong-{{page.versions.ce}}.amd64.deb "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/deb/debian/pool/bullseye/main/k/ko/kong_{{page.versions.ce}}/kong_{{page.versions.ce}}_amd64.deb"
curl -Lo kong-{{page.versions.ce}}.deb "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/deb/debian/pool/bullseye/main/k/ko/kong_{{page.versions.ce}}/kong_{{page.versions.ce}}_$(dpkg --print-architecture).deb"
```
{% endnavtab %}
{% endnavtabs_ee %}
Expand All @@ -67,12 +67,12 @@ curl -Lo kong-{{page.versions.ce}}.amd64.deb "{{ site.links.cloudsmith }}/public
{% navtabs_ee codeblock %}
{% navtab Kong Gateway %}
```bash
sudo apt install -y ./kong-enterprise-edition-{{page.versions.ee}}.amd64.deb
sudo apt install -y ./kong-enterprise-edition-{{page.versions.ee}}.deb
```
{% endnavtab %}
{% navtab Kong Gateway (OSS) %}
```bash
sudo apt install -y ./kong-{{page.versions.ce}}.amd64.deb
sudo apt install -y ./kong-{{page.versions.ce}}.deb
```
{% endnavtab %}
{% endnavtabs_ee %}
Expand Down
4 changes: 2 additions & 2 deletions app/_src/gateway/install/linux/rhel.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ Install {{site.base_gateway}} on RHEL from the command line.
{% navtabs_ee codeblock %}
{% navtab Kong Gateway %}
```bash
curl -Lo kong-enterprise-edition-{{page.versions.ee}}.rpm $(rpm --eval {{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/rpm/el/%{rhel}/x86_64/kong-enterprise-edition-{{page.versions.ee}}.el%{rhel}.x86_64.rpm)
curl -Lo kong-enterprise-edition-{{page.versions.ee}}.rpm $(rpm --eval {{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/rpm/el/%{rhel}/%{_arch}/kong-enterprise-edition-{{page.versions.ee}}.el%{rhel}.%{_arch}.rpm)
```
{% endnavtab %}
{% navtab Kong Gateway (OSS) %}
```bash
curl -Lo kong-{{page.versions.ce}}.rpm $(rpm --eval {{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/rpm/el/%{rhel}/x86_64/kong-{{page.versions.ce}}.el%{rhel}.x86_64.rpm)
curl -Lo kong-{{page.versions.ce}}.rpm $(rpm --eval {{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/rpm/el/%{rhel}/%{_arch}/kong-{{page.versions.ce}}.el%{rhel}.%{_arch}.rpm)
```
{% endnavtab %}
{% endnavtabs_ee %}
Expand Down
10 changes: 5 additions & 5 deletions app/_src/gateway/install/linux/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ Install {{site.base_gateway}} on Ubuntu from the command line.
{% navtabs_ee codeblock %}
{% navtab Kong Gateway %}
```bash
curl -Lo kong-enterprise-edition-{{page.versions.ee}}.amd64.deb "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/deb/ubuntu/pool/{{ ubuntu_flavor }}/main/k/ko/kong-enterprise-edition_{{page.versions.ee}}/kong-enterprise-edition_{{page.versions.ee}}_amd64.deb"
curl -Lo kong-enterprise-edition-{{page.versions.ee}}.deb "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/deb/ubuntu/pool/{{ ubuntu_flavor }}/main/k/ko/kong-enterprise-edition_{{page.versions.ee}}/kong-enterprise-edition_{{page.versions.ee}}_$(dpkg --print-architecture).deb"
```
{% endnavtab %}
{% navtab Kong Gateway (OSS) %}
```bash
curl -Lo kong-{{page.versions.ce}}.amd64.deb "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/deb/ubuntu/pool/{{ ubuntu_flavor }}/main/k/ko/kong_{{page.versions.ce}}/kong_{{page.versions.ce}}_amd64.deb"
curl -Lo kong-{{page.versions.ce}}.deb "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/deb/ubuntu/pool/{{ ubuntu_flavor }}/main/k/ko/kong_{{page.versions.ce}}/kong_{{page.versions.ce}}_$(dpkg --print-architecture).deb"
```
{% endnavtab %}
{% endnavtabs_ee %}
Expand All @@ -129,12 +129,12 @@ curl -Lo kong-{{page.versions.ce}}.amd64.deb "{{ site.links.cloudsmith }}/public
{% navtabs_ee codeblock %}
{% navtab Kong Gateway %}
```bash
sudo apt install -y ./kong-enterprise-edition-{{page.versions.ee}}.amd64.deb
sudo apt install -y ./kong-enterprise-edition-{{page.versions.ee}}.deb
```
{% endnavtab %}
{% navtab Kong Gateway (OSS) %}
```bash
sudo apt install -y ./kong-{{page.versions.ce}}.amd64.deb
sudo apt install -y ./kong-{{page.versions.ce}}.deb
```
{% endnavtab %}
{% endnavtabs_ee %}
Expand All @@ -155,7 +155,7 @@ Install the APT repository from the command line.
1. Setup the Kong APT repository:
```bash
curl -1sLf "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/gpg.{{ gpg_key }}.key" | gpg --dearmor | sudo tee /usr/share/keyrings/kong-gateway-{{ page.major_minor_version }}-archive-keyring.gpg > /dev/null
curl -1sLf "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/config.deb.txt?distro=ubuntu&codename=focal" | sudo tee /etc/apt/sources.list.d/kong-gateway-{{ page.major_minor_version }}.list > /dev/null
curl -1sLf "{{ site.links.cloudsmith }}/public/gateway-{{ page.major_minor_version }}/config.deb.txt?distro=ubuntu&codename={{ ubuntu_flavor }}" | sudo tee /etc/apt/sources.list.d/kong-gateway-{{ page.major_minor_version }}.list > /dev/null
```

2. Update the repository:
Expand Down
39 changes: 37 additions & 2 deletions tools/install-tester/config/jobs.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,54 @@
- match: "3\\..*"
- match:
version: "3\\.[2-99]\\.*"
package:
- enterprise
distros:
- amazon-linux
- ubuntu
- debian
- rhel
skip:
- 3.2.x/debian/enterprise/package
- 3.2.x/debian/enterprise/repository
- 3.3.x/debian/enterprise/package
- 3.3.x/debian/enterprise/repository
- 3.2.x/rhel/enterprise/package
- 3.2.x/rhel/enterprise/repository
- 3.3.x/rhel/enterprise/package
- 3.3.x/rhel/enterprise/repository
arch:
- linux/arm64
outputs:
enterprise: "Kong Enterprise {{ version }}"

- match:
version: "3\\..*"
package:
- oss
- enterprise
distros:
- amazon-linux
- ubuntu
- rhel
- debian
arch:
- linux/amd64
outputs:
enterprise: "Kong Enterprise {{ version }}"
oss: "{{ version }}"
- match: "2\\..*"
- match:
version: "2\\..*"
package:
- oss
- enterprise
distros:
- ubuntu
- rhel
- amazon-linux
- debian
- centos
arch:
- linux/amd64
skip:
- 2.8.x/centos/oss/package # No OSS package for 2.8
- 2.8.x/centos/oss/repository # No OSS package for 2.8
Expand Down
4 changes: 2 additions & 2 deletions tools/install-tester/config/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ debian:
- usermod -aG sudo tester
- "echo 'ALL ALL = (ALL) NOPASSWD: ALL' > /etc/sudoers.d/tester"
rhel:
image: "registry.access.redhat.com/ubi7/ubi-init:latest"
image: "registry.access.redhat.com/ubi9/ubi-init:latest"
setup:
- yum install -y curl gpg sudo
- yum install -y gpg sudo
- useradd tester -m -p password
- "echo 'ALL ALL = (ALL) NOPASSWD: ALL' > /etc/sudoers.d/tester"
amazon-linux:
Expand Down
40 changes: 21 additions & 19 deletions tools/install-tester/execute-in-docker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = async function (distro, steps) {
module.exports = async function (distro, steps, platform) {
const Dockerode = require("dockerode");
const streams = require("memory-streams");
const fs = require("fs");
Expand All @@ -11,6 +11,10 @@ module.exports = async function (distro, steps) {

const docker = new Dockerode({ socketPath: "/var/run/docker.sock" });

if (!platform) {
throw new Error("No platform specified");
}

let setup = config[distro].setup;
if (!setup) {
throw new Error(`No setup found for ${distro}`);
Expand All @@ -19,7 +23,9 @@ module.exports = async function (distro, steps) {

steps = steps.join(" && ").replace("\n", " && ");
if (steps.trim().length == 0) {
throw new Error(`Unable to fetch install instructions from docs for ${distro}`);
throw new Error(
`Unable to fetch install instructions from docs for ${distro}`,
);
}

const asUser = `su tester -c 'cd ~ && ${steps} && kong version'`;
Expand All @@ -28,33 +34,29 @@ module.exports = async function (distro, steps) {

// Pull the image
await new Promise((resolve, reject) => {
docker.pull(
config[distro].image,
{ platform: "linux/amd64" },
(err, stream) => {
if (err) {
return reject(err);
}
docker.pull(config[distro].image, { platform }, (err, stream) => {
if (err) {
return reject(err);
}

docker.modem.followProgress(stream, onFinished, onProgress);
docker.modem.followProgress(stream, onFinished, onProgress);

function onFinished(err, output) {
if (err) {
return reject(err);
}
return resolve(output);
function onFinished(err, output) {
if (err) {
return reject(err);
}
function onProgress(event) {}
},
);
return resolve(output);
}
function onProgress(event) {}
});
});

return new Promise((resolve, reject) => {
docker.run(
config[distro].image,
["bash", "-c", completeString],
[stdout, stderr],
{ Tty: false, HostConfig: { AutoRemove: true }, platform: "linux/amd64" },
{ Tty: false, HostConfig: { AutoRemove: true }, platform },
function (err, data, container) {
if (err) {
return reject(err);
Expand Down
Loading

0 comments on commit 2d9d9c4

Please sign in to comment.