You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Developer.wikimedia.org: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>BryanDavis
(Redirected page to Developer Portal)
 
imported>BryanDavis
(Improve lead paragraph; reorganize sections)
Line 1: Line 1:
#REDIRECT [[Developer Portal]]
{{ptag|Wikimedia-Developer-Portal}}
 
'''developer.wikimedia.org''' ('''Developer Portal''') is a central entry point for Wikimedia technical documentation. The portal is a static site built using [https://www.mkdocs.org/ MkDocs] and [https://squidfunk.github.io/mkdocs-material/ Material for MkDocs]. It uses a custom plugin to generate [https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html PO files] and integrate with translatewiki.net. For more information about the project, see [[mw:Developer Advocacy/Developer Portal]].
 
== Production deployment ==
{{See also|Kubernetes/Deployments}}
{{Tracked|T297140}}
 
# Create a patch to update main_app.version in {{Gitweb|project=operations/deployment-charts|file=helmfile.d/services/developer-portal/values.yaml|text=helmfile.d/services/developer-portal/values.yaml}} to the desired tag of the [https://docker-registry.wikimedia.org/wikimedia/wikimedia-developer-portal/tags/ wikimedia/wikimedia-developer-portal container]. ([[gerrit:799416|example]])
# CR+2 the helmfile.d patch in gerrit to start the merge process.
# Ssh to the currently active [[Deployment server|deployment server]] (''deployment.eqiad.wmnet'').
# ''cd /srv/deployment-charts/helmfile.d/services/developer-portal''
# Verify that your changes from step 1 are checked out. The git clone is updated once a minute by a timer, so if your changes are not present yet double check that zuul has merged the change and then wait patiently for the update to be fetched.
# Deploy the chart to the staging cluster: ''helmfile -e staging -i apply''
# Deploy the chart to the codfw cluster: ''helmfile -e codfw -i apply''
# Deploy the chart to the eqiad cluster: ''helmfile -e eqiad -i apply''
 
== Demo server ==
{{Tracked|T297800|Resolved}}
 
A demo server is available at https://developer-portal.wmcloud.org/. This proxy points to an instance in the [[Nova Resource:Devportal|"devportal" Cloud VPS project]] which uses [https://docs.podman.io/en/latest/index.html Podman] to run the latest developer portal container as built by [[PipelineLib]]. A systemd timer runs [https://docs.podman.io/en/latest/markdown/podman-auto-update.1.html podman auto-update] every 5 minutes to poll for newer container versions.
 
The demo server was manually built and does not currently have any Puppet automation to build a new instance. The manual work needed however is a relatively small amount of effort thanks to the magic of podman:
{{Codesample|lang=shell-session|scheme=light|code=
$ sudo apt install podman
$ sudo podman pull docker-registry.wikimedia.org/wikimedia/wikimedia-developer-portal:latest
$ sudo podman run --name developer-portal --label 'io.containers.autoupdate=image' --rm --detach --publish 0.0.0.0:8000:8000 docker-registry.wikimedia.org/wikimedia/wikimedia-developer-portal:latest
$ sudo podman generate systemd --new --name developer-portal {{!}} sudo tee /etc/systemd/system/developer-portal.service
$ sudo systemctl enable developer-portal
$ sudo systemctl start developer-portal
$ sudo systemctl edit podman-auto-update.timer # Set to run every 5m
$ sudo systemctl enable podman-auto-update.service
$ sudo systemctl start podman-auto-update.service
}}

Revision as of 21:36, 27 May 2022


developer.wikimedia.org (Developer Portal) is a central entry point for Wikimedia technical documentation. The portal is a static site built using MkDocs and Material for MkDocs. It uses a custom plugin to generate PO files and integrate with translatewiki.net. For more information about the project, see mw:Developer Advocacy/Developer Portal.

Production deployment

  1. Create a patch to update main_app.version in helmfile.d/services/developer-portal/values.yaml to the desired tag of the wikimedia/wikimedia-developer-portal container. (example)
  2. CR+2 the helmfile.d patch in gerrit to start the merge process.
  3. Ssh to the currently active deployment server (deployment.eqiad.wmnet).
  4. cd /srv/deployment-charts/helmfile.d/services/developer-portal
  5. Verify that your changes from step 1 are checked out. The git clone is updated once a minute by a timer, so if your changes are not present yet double check that zuul has merged the change and then wait patiently for the update to be fetched.
  6. Deploy the chart to the staging cluster: helmfile -e staging -i apply
  7. Deploy the chart to the codfw cluster: helmfile -e codfw -i apply
  8. Deploy the chart to the eqiad cluster: helmfile -e eqiad -i apply

Demo server

A demo server is available at https://developer-portal.wmcloud.org/. This proxy points to an instance in the "devportal" Cloud VPS project which uses Podman to run the latest developer portal container as built by PipelineLib. A systemd timer runs podman auto-update every 5 minutes to poll for newer container versions.

The demo server was manually built and does not currently have any Puppet automation to build a new instance. The manual work needed however is a relatively small amount of effort thanks to the magic of podman:

$ sudo apt install podman
$ sudo podman pull docker-registry.wikimedia.org/wikimedia/wikimedia-developer-portal:latest
$ sudo podman run --name developer-portal --label 'io.containers.autoupdate=image' --rm --detach --publish 0.0.0.0:8000:8000 docker-registry.wikimedia.org/wikimedia/wikimedia-developer-portal:latest
$ sudo podman generate systemd --new --name developer-portal | sudo tee /etc/systemd/system/developer-portal.service
$ sudo systemctl enable developer-portal
$ sudo systemctl start developer-portal
$ sudo systemctl edit podman-auto-update.timer # Set to run every 5m
$ sudo systemctl enable podman-auto-update.service
$ sudo systemctl start podman-auto-update.service