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

Release "dev" shows kumactl 1.5.0 in installation instructions #960

Closed
slonka opened this issue Aug 16, 2022 · 9 comments · Fixed by #1149
Closed

Release "dev" shows kumactl 1.5.0 in installation instructions #960

slonka opened this issue Aug 16, 2022 · 9 comments · Fixed by #1149
Labels
area/infra Anything related the inner workings rather of the site rather than content (Jekyll, CSS...) kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it

Comments

@slonka
Copy link
Contributor

slonka commented Aug 16, 2022

What happened?

image

The version should probably be the current preview version.

@slonka slonka added triage/pending This issue will be looked at on the next triage meeting kind/bug A bug labels Aug 16, 2022
@jakubdyszkiewicz
Copy link
Contributor

Triage: apparently there is a script called preview.sh that we should use here.

@jakubdyszkiewicz jakubdyszkiewicz added triage/accepted The issue was reviewed and is complete enough to start working on it and removed triage/pending This issue will be looked at on the next triage meeting labels Aug 16, 2022
@lahabana
Copy link
Contributor

lahabana commented Oct 5, 2022

preview.sh would be tricky and messy... The version is extracted from: https://github.com/kumahq/kuma-website/blob/master/docs/docs/dev/versions.json. Maybe we should just have notAvailable I guess users playing with the dev docs know what they are doing?

@lahabana lahabana added the area/infra Anything related the inner workings rather of the site rather than content (Jekyll, CSS...) label Oct 31, 2022
@kleinfreund
Copy link
Contributor

kleinfreund commented Nov 1, 2022

After the replatform, the versions file is now located at https://github.com/kumahq/kuma-website/blob/c7d2d266ba3942362a3676cd955bfbdca3a397fc/app/_data/versions.yml.

Also, after the replatform, the dev docs use VERSION=2.0.0 in installation instructions (e.g. https://kuma.io/docs/dev/installation/kubernetes/).

@lahabana Looking at https://kuma.io/preview.sh, you say this is messy because it relies on GitHub CLI, right?

In that case, should the dev docs simply show installation instructions without VERSION being explicitly set? This would try and use the latest version as per https://kuma.io/latest_version. Right now that would be 1.8.1 instead of 2.0.0.

The next question is which direct download URLs we would use. Currently we use the URLs referencing 2.0.0 (e.g. https://download.konghq.com/mesh-alpine/kuma-2.0.0-ubuntu-amd64.tar.gz). Looking at https://download.konghq.com/mesh-alpine/, there are version-less archives (e.g. https://download.konghq.com/mesh-alpine/kuma-ubuntu-amd64.tar.gz), but they seem to contain an old version.

@lahabana
Copy link
Contributor

lahabana commented Nov 2, 2022

For KM the link it should link to a kong-mesh build anyway (the script used should be https://docs.konghq.com/mesh/installer.sh).

I'm not sure latest_version is perfect either. Could we have preview as a version in versions.yml and then have a condition in installer.sh to error and say you should use preview.sh? We really don't need anything perfect here as dev is mostly used by us and we know what we're doing :)

@kleinfreund
Copy link
Contributor

kleinfreund commented Nov 2, 2022

I'm not sure latest_version is perfect either. Could we have preview as a version in versions.yml and then have a condition in installer.sh to error and say you should use preview.sh? We really don't need anything perfect here as dev is mostly used by us and we know what we're doing :)

@lahabana I think that would work, yes. Are you proposing this to make it so that we can use the same curl -L https://kuma.io/installer.sh | VERSION=$VERSION sh - type commands across all docs (i.e. we wouldn’t have to have conditional logic in the future "one source document for version pages" style)? Because otherwise we could just use preview.sh, no?

@kleinfreund
Copy link
Contributor

This is actually more tricky.

In the installation instructions for Docker, we reference the latest version variable several times, for example:

- **kuma-cp**: at `docker.io/kumahq/kuma-cp:{{ page.latest_version }}`
- **kuma-dp**: at `docker.io/kumahq/kuma-dp:{{ page.latest_version }}`
- **kumactl**: at `docker.io/kumahq/kumactl:{{ page.latest_version }}`

In general installation instructions, we commonly use the install_os.md snippet with the latest version variable, for example:

Then extract the archive with: `tar xvzf kuma-{{ page.latest_version }}`.

We would also need to conditionally switch between the latest version number and the preview version number depending on context here:

<pre class="no-line-numbers"><code>curl -L https://kuma.io/installer.sh | VERSION={{ page.latest_version }} sh -</code></pre>


With a version marked as preview: true in the versions.yml file, we would have access to an appropriate version number.

Perhaps we can provide the version number in includes like this:

{% include snippets/install_os.md version=page.latest_version %}
<!-- or -->
{% include snippets/install_os.md version=page.preview_version %}

and use that in the snippet. I’ll play around with that approach.

@kleinfreund
Copy link
Contributor

I’m stuck on this. It seems that the only reliable kind of version number we should be using for the dev docs is one of the form 0.0.0-preview.v${COMMIT} which isn’t possible with the current setup because to determine it you need git access to the repository or a GitHub CLI API call (i.e. what we do in the preview.sh script). In theory it’s probably possible to determine this version number once when building the docs website, but this version number would quickly become out-of-date.

Using a preview version keyword would work for triggering some special-cased logic in the installer.sh script, but there are many other references for which that wouldn’t work:

  • Archive download URLs: https://download.konghq.com/mesh-alpine/kuma-{{ page.latest_version }}-{{ page.os }}-{{ page.arch }}.tar.gz
  • Docker image URLs: docker.io/kumahq/kuma-cp:{{ page.latest_version }}

We would need to publish images and archives for the preview version keyword to make that work.

@lahabana
Copy link
Contributor

lahabana commented Nov 3, 2022

Other option is to have page.latest_version set at build times by doing the github stuff then? Or doing it as nightly workflow?

@kleinfreund
Copy link
Contributor

Other option is to have page.latest_version set at build times by doing the github stuff then?

That version would be out-of-date as soon as we publish a new preview version. For the dev docs, that’s perhaps tolerable?

Or doing it as nightly workflow?

As in rebuilding and redeploying the site every night? That would keep the preview version pretty up-to-date. The choice depends on how precise we want this to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/infra Anything related the inner workings rather of the site rather than content (Jekyll, CSS...) kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants