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

ocp13 replacement #518

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

ocp13 replacement #518

wants to merge 18 commits into from

Conversation

RobHooper
Copy link
Contributor

Resolves #494 and #504.

@RobHooper RobHooper self-assigned this Aug 21, 2024
@jpmckinney
Copy link
Member

jpmckinney commented Sep 27, 2024

I have noted that scrapyd needs a project configuring, on ocp13 this is configured under the datlab user (/home/datlab/.config/scrapy.cfg).

@RobHooper Is it that you observed that e.g. collect.data.open-contracting.org lists no projects? That's because we need to do something like scrapyd-deploy registry from our local computers. Not sure why Datlab has that config.

  • We can document this on a new page for the registry.

@jpmckinney
Copy link
Member

I will enable mod_md again when DNS is live (sending too many failed requests, as we are at the moment, causes Lets Encrypt to block us).

Yeah, I have a note about that in the docs https://ocdsdeploy.readthedocs.io/en/latest/develop/update/apache.html

Let’s Encrypt will reach a Failed Validation limit if DNS is not propagated.

I've now also added:

In the meantime, you can use Let’s Encrypt’s staging environment.

@jpmckinney
Copy link
Member

jpmckinney commented Sep 27, 2024


James when you have a moment, please can you confirm what data needs migrating to the new server from /data/.

332M	/data/storage/spoonbill

Yes, we also need to move /data/storage/spoonbill (looks like you already have).

It contains the Django media files for that project. It has a var subdirectory which is not referenced by anything and that has no changes since 2021, so I deleted it on both the old and new server (I assume it was from an old version).


Alongside this work, we can remove state ntp disabling the NTP service. This was only required for older systems (Ubuntu 20.04).
https://github.com/open-contracting/deploy/blob/main/salt/core/systemd/ntp.sls#L31-L34

  • @RobHooper Did you want to do this, or you decided not to?

For the data support server, we have:

Adjust reserved disk space to 1% for large disks:

tune2fs -m 1 /dev/md2

  • Do we want to do this for the registry server?

@jpmckinney
Copy link
Member

jpmckinney commented Sep 27, 2024

In terms of migration process, is this the plan?

  • Do we adjust the TTLs to speed up the DNS switchover?
  • ocp13: Remove/comment out DATA_REGISTRY_CBOM so that new jobs aren't started
  • ocp13: Delete /etc/cron.d/postgres_backups
  • ocp27: We should re-copy any new files (data/storage/exporter) and databases from ocp13
  • ocp27: Can we copy the mod_md files for data.open-contracting.org from ocp13? If so, we want to also restore the Apache conf files and reload Apache.
  • GoDaddy: Change the DNS over for data.open-contracting.org
  • Run scrapyd-deploy once DNS has propagated
  • Deploy ocp27 with Salt, to install the deployer's crontab and the postgres_backups
  • When satisfied, decommission ocp13

Copy link
Member

@jpmckinney jpmckinney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just one comment.

@@ -5,6 +5,8 @@ awscli:
- name: python3-pip
pip.installed:
- name: awscli
- extra_args:
- --break-system-packages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment about why this option is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required on systems with Python 3.11 and newer.
I have added a comment and a Jinja if statement so it only runs where needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this flag also needed on the pip.installed state in kingfisher/init.sls?

@jpmckinney
Copy link
Member

I added a documentation page that covers most of what I wrote above (except where I still have a question). Please add the steps to restore the data_registry and spoonbill databases from backups.

We should add a subheading on this other page, and explain in general how to restore from individual database backups versus the existing docs about pgBackrest backups: https://ocdsdeploy.readthedocs.io/en/latest/maintain/databases.html#restore-from-backup We can then just link to that from the registry page.

@RobHooper
Copy link
Contributor Author

In the meantime, you can use Let’s Encrypt’s staging environment.

The Lets Encrypt staging environment won't generate SSL certificates without live DNS, so this doesn't help in this situation.

@RobHooper Did you want to [remove the disable NTP state], or you decided not to?

This was already done in a previous PR :)

Do we want [modify reserved disk bytes] for the registry server?

Yes, I have ran tune2fs -m 1 /dev/md2 now.
I think we should run this by default on any disk larger than ~50GBs.
Where would be best to document this?

@jpmckinney
Copy link
Member

Where would be best to document this?

Probably at an appropriate step in create_server.rst, and maybe as a note at https://ocdsdeploy.readthedocs.io/en/latest/maintain/hosting.html#rescale-a-server

@jpmckinney
Copy link
Member

The Lets Encrypt staging environment won't generate SSL certificates without live DNS, so this doesn't help in this situation.

It helps to not get temporarily blocked by Let's Encrypt :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade ocp13 (registry) to Ubuntu 24.04 LTS
2 participants