deploy_server_patch - ryzom/ryzomcore GitHub Wiki


title: Deploy Server Patch description: published: true date: 2023-03-01T05:14:13.864Z tags: editor: markdown dateCreated: 2020-11-14T03:33:58.414Z

Once you've prepared your server patch, and optionally prepared and pre-published your client patch (TODO: Link), you're ready to deploy the latest version to your servers.

This process works both for installing a new server, and for upgrading an existing server.

Upload the server patch

The c1_shard_patch.py script, which was run in the previous step, prepared the new patch under Y:\ryzomcore\pipeline\bridge_server. Upload this folder to /home/nevrax/bridge_server on the VM which is running your Patchman Bridge.

It is recommended to automate this step using rclone or rsync. The following batch script is provided as an example.

rem Remote sfo2 is a DigitalOcean Spaces storage with CDN rclone copy "Y:\ryzomcore\pipeline\client_patch\patch" sfo2:ryzom/core/patch --verbose if %errorlevel% neq 0 pause rem Remote classic is an SFTP server running the patchman bridge server rclone sync "Y:\ryzomcore\pipeline\bridge_server" demo:bridge_server --verbose --exclude /.patchman.file_index pause {.is-info}

Upgrade the Patchman services

Launch the patchman terminal. Wait for all the services to connect.

Update and restart all patchman services.

  • Quit PAMs to update the bridge file listing, wait for all the services to come back up
  • Update PAMs
  • Wait until it says READY TO RESTART (or any error state) on all services when hitting PAM States
  • Then Quit PAMs again to run the upgrade, wait for all the services to come back up
  • Check Update PAMs, to verify if all PAMs are at the latest version correctly, it will say up to date when hitting PAM States

If it failed, try again. In case of serious failure (patchman does not come back online, for example), you must shut all shards and services down and reinstall Patchman services to recover.

Distribute the server patch

The server patch can be distributed before shutting down the servers, only if none of the server layout has changed. Otherwise, you will have conflicting configurations, as Patchman is also used to update and deploy live configuration changes.

If you are changing the shard layout, shut down all the shards of this domain first. Assuming a domain named demo, issue the following commands from /home/nevrax, on each server.

cd bin ./domain_demo stop

Then, hit the Deploy button in the Patchman Terminal, before proceeding. This reconfigures all the servers. {.is-danger}

To distribute the patch to all servers, issue the following command in the Patchman Terminal, substituting demo with your domain name, and 000018 with the applicable patch number, as can be found in the bridge_server folder.

terminal.install demo 000018 

Verify SPA States, and wait for all servers in the domain to have finished downloading and unpacking the specified version. You will see something like live 17 inst 18 untared on all the SPAs.

Shut down the shards

If the shards are still running, shut them down now. This is a manual step, that should be done by Patchman in the future. Assuming a domain named demo, issue the following commands from /home/nevrax, on each server. Shut down the VM with the Shard Unifier last.

cd bin
./domain_demo stop

Verify on the web admin panel that all the services have gone offline.

Make backups

This is a good time to download a backup snapshot of your shards from the Shard Unifier.

  • /home/nevrax/demo/save_shard_lgs
  • /home/nevrax/demo/save_shard_bs
  • /home/nevrax/demo/save_shard_www

A backup of your SQL server is also advised.

Publish the client patch

If you have a client patch, this is the time to publish your client patch version in the NeL domains SQL.

Install the server patch

Hit the Deploy button on Patchman to publish all the latest configuration files.

Issue the following command to switch over to the patched installation. Adjust as previously described.

terminal.launch demo 000018

Verify the status through the admin panel.

The shard will be up and running now. That's it.

Troubleshooting

Troubleshooting

⚠️ **GitHub.com Fallback** ⚠️