gigascience / gigadb-website

Source code for running GigaDB
http://gigadb.org
GNU General Public License v3.0
9 stars 15 forks source link

Create a command to perform DNS records swap so that we don't have to do it manually. #2041

Open rija opened 1 month ago

rija commented 1 month ago

User story

As a developer
I want a tool to perform DNS record swap
So that rapidly and safely switch DNS record between Current Production and Hot Stand-by infrastructures

Acceptance criteria

Given Upstream project's staging is available at staging.gigadb.org and the UpstreamAlt project's staging is available at alt-staging.gigadb.host When I run the DNS swap tool as domainswap --apply Then UpstreamAlt project's staging is available at staging.gigadb.org And Upstream project's staging is available at alt-staging.gigadb.host

Given Upstream project's staging is available at alt-staging.gigadb.host and the UpstreamAlt project's staging is available at staging.gigadb.org When I run the DNS swap tool as domainswap --apply Then Upstream project's staging is available at staging.gigadb.org And UpstreamAlt project 's staging is available at alt-staging.gigadb.host

Given Upstream project 's live is available at gigadb.org and the UpstreamAlt project's live is available at alt-live.gigadb.host When I run the DNS swap tool as domainswap --apply Then Upstream project's live is available at alt-live.gigadb.host And UpstreamAlt project's live is available at gigadb.org

Given Upstream project's live is available at alt-live.gigadb.host and the UpstreamAlt project's live is available at gigadb.org When I run the DNS swap tool as domainswap --apply Then Upstream project's live is available at gigadb.org And UpstreamAlt project's live is available at alt-live.gigadb.host

Given Upstream project 's live is available at files.gigadb.org and the UpstreamAlt project's live is available at files.alt-live.gigadb.host When I run the DNS swap tool as domainswap --apply Then Upstream project's live is available at files.alt-live.gigadb.host And UpstreamAlt project's live is available at files.gigadb.org

Given Upstream project's live is available at files.alt-live.gigadb.host and the UpstreamAlt project's live is available at files.gigadb.org When I run the DNS swap tool as domainswap --apply Then Upstream project's live is available at files.gigadb.org And UpstreamAlt project's live is available at files.alt-live.gigadb.host

Given Upstream project 's live is available at gigadb.org and the UpstreamAlt project's live is available at alt-live.gigadb.host When I run the DNS swap tool as domainswap --plan Then I should see the list of records currently assocated with each infrastructure and how will that change if we are to apply the changes

Additional Info

Cloudflare API docs will be useful: https://developers.cloudflare.com/dns/manage-dns-records/how-to/create-dns-records/#create-dns-records

A possible approach is to use Bind Zone files, and then use Cloudflare import/export API: https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ The problem with using exclusively that approach is that a zone file contains all domains for both staging and live and need to do the switch for specific environment. The export of zone file is still useful for ensuring we have a full list and a backup of all the records.

Tasks:

Product Backlog Item Ready Checklist

Product Backlog Item Done Checklist

rija commented 1 month ago

can this help with no-dowtime backup of the database?