Skip to content
Snippets Groups Projects
Alex Iribarren's avatar
c7dd601b
History

Linux web

This repo follows https://how-to.docs.cern.ch.

  • linux is the production site and it must always use the default master branch as a Git Reference on the BuildConfig.

    • linux-qa will use the Git Reference on the latest feature branch, as it changes with every CI job nor on master branch.
  • We have a CNAME registered that we then use for a redirect, i.e. linux-qa.cern.ch -> linux-qa.web.cern.ch, to replicate the old website behaviour.

    • Redirection is done with a simple nginx redirection, deployed with oc create -f nginx-redirect-(qa/prod).yaml.
  • For https://linux-qa.web.cern.ch and https://linux.web.cern.ch we use KB0006299 solution for a Let's encrypt certificate.

  • This repo adds some useful redirections to ease with any old URL format. Check nginx-default-cfg/redirect.conf file for more details. This directory and its contents follow the documentation

Customisations

CI/CD

Instead of relying on webhooks as suggested by https://how-to.docs.cern.ch, we run builds on CI so we can notice whether they fail or not.

This requires setting up a service account on each namespace:

oc login openshift.cern.ch
oc project linux-qa
oc create sa openshift-operations
oc policy add-role-to-user admin system:serviceaccount:linux-qa:openshift-operations
oc sa get-token openshift-operations
# Note the token on https://gitlab.cern.ch/groups/linuxsupport/-/settings/ci_cd -> LINUXWEB_QA_OPENSHIFT. REMEMBER TO SELECT MASK VARIABLE!!!
oc project linux
oc create sa openshift-operations
oc policy add-role-to-user admin system:serviceaccount:linux:openshift-operations
oc sa get-token openshift-operations
# Note the token on https://gitlab.cern.ch/groups/linuxsupport/-/settings/ci_cd -> LINUXWEB_PROD_OPENSHIFT. REMEMBER TO SELECT MASK VARIABLE!!!

Known issues and limitations

  • Due to the size of our documentation we need to edit the corresponding BuildConfig object with specific limits so it does not use the default ones:
# Edit the buildconfig object
oc edit buildconfig linux-docs
# Add the following section:
spec:
  (...)
  resources:
    limits:
      memory: 1Gi
    requests:
      memory: 512Mi

Archive

Following a similar setup (except for the nginx-redirect as this one is not necessary) we have prepared https://gitlab.cern.ch/linuxsupport/websites/linux-archive.web.cern.ch for archiving old content. This helps reducing the building time, as for example splitting old SLC6 updates in a different project.

Upgrading or updating MkDocs configuration

As of August 2021 we still use https://gitlab.cern.ch/authoring/documentation/s2i-mkdocs-container which is now considered unmaintained.

If we ever update the image version, we need to follow certain steps:

To deploy the new MkDocs image, go to your Openshift project -> Builds -> linux-docs -> Edit -> Change the image stream version to the desired one.

Note that if this is no longer maintained we may need to use a fork of it and maintain our own versions, Image Streams and so on.