Idea #9053
openPort API server to Go
Description
Background¶
We want to replace our Rails server with a Go server. However:- Porting the entire code base to Go, and cutting over everything at once, seems unlikely to go smoothly.
- In the time it takes to port, the Rails functionality will change. Keeping them in sync will be challenging.
- Porting the functionality and the corresponding tests at once is likely to result in unnoticed errors and omissions.
Development approach¶
The first version of the Go service is just an HTTP proxy: it forwards each request to a configured upstream Rails API server. Nginx configs in the install docs (and existing deployments) are updated to send API requests to this new server. #13497
Next, port some functional/integration tests from the Rails server code base to the Go code base. These tests will pass because Go server is already proxying the relevant requests to the Rails server. (Mocking won't be portable, though!)
Each test that has been ported to Go can be skipped in the Rails code base.
When enough Rails tests are skipped to remove an API from Rails without making the remaining tests fail, that API can be ported to Go. The relevant tests are already in place in the Go code base, so they should be a reasonable way to confirm that the new Go port is correct.
Repeat until all tests are ported to Go, and they pass even with the proxy-to-Rails feature removed.
Caveats / TBD¶
Rails tests are fast (at least faster than Workbench tests, for example) because they use transaction rollback to reset database state. This option won't be available when tests run in a different (Go) process. Practically, this means the Go tests will need to use the "database reset" API, and they will run slowly.- Perhaps we can start by implementing "database reset" in Go? It will have direct access to the Postgres database, and it could take a snapshot of the database at startup instead of reading the Rails YAML fixtures.
- Is there a better way around this?
Updated by Tom Clegg over 6 years ago
- Related to Feature #13493: Federated record retrieval added
Updated by Tom Clegg over 6 years ago
- Subject changed from [API] Deployable Go API server that proxies unimplemented APIs to Rails to [Epic] Port APIs to Go
- Description updated (diff)
Updated by Tom Clegg over 6 years ago
- Blocked by Idea #13497: [API] Initial "arvados-controller" server that proxies API endpoints to Rails server added
Updated by Tom Clegg over 6 years ago
- Related to Idea #13995: [Controller] Port "collection update" functional tests from Rails API to controller test suite added
Updated by Tom Clegg over 6 years ago
- Related to Idea #13997: [Controller] Port "collection update" API from Rails added
Updated by Peter Amstutz almost 5 years ago
- Subject changed from [Epic] Port APIs to Go to Port API server to Go
- Project changed from Arvados to Arvados Epics
Updated by Peter Amstutz almost 5 years ago
- Start date set to 08/01/2020
- Due date set to 02/01/2021
Updated by Peter Amstutz over 4 years ago
- Start date changed from 08/01/2020 to 09/01/2020
- Due date changed from 02/01/2021 to 03/01/2021
Updated by Peter Amstutz over 4 years ago
- Start date changed from 09/01/2020 to 10/01/2020
- Due date changed from 03/01/2021 to 04/01/2021
Updated by Peter Amstutz over 4 years ago
- Start date changed from 10/01/2020 to 02/01/2021
- Due date changed from 04/01/2021 to 07/30/2021
Updated by Peter Amstutz about 4 years ago
- Start date changed from 02/01/2021 to 04/01/2021
- Due date changed from 07/30/2021 to 09/30/2021
Updated by Nico César about 4 years ago
- Related to Feature #17014: Add Container Requests endpoint to controller added
Updated by Peter Amstutz almost 4 years ago
- Start date changed from 04/01/2021 to 09/01/2021
- Due date changed from 09/30/2021 to 03/31/2022
Updated by Peter Amstutz over 3 years ago
- Start date changed from 09/01/2021 to 01/01/2022
- Due date changed from 03/31/2022 to 06/30/2022
Updated by Peter Amstutz about 3 years ago
- Start date changed from 01/01/2022 to 06/01/2022
- Due date changed from 06/30/2022 to 12/31/2022
Updated by Peter Amstutz almost 3 years ago
- Start date changed from 06/01/2022 to 01/01/2023
- Due date changed from 12/31/2022 to 05/31/2023
Updated by Peter Amstutz over 2 years ago
- Start date changed from 01/01/2023 to 04/01/2023
- Due date changed from 05/31/2023 to 10/31/2023
Updated by Peter Amstutz almost 2 years ago
- Start date changed from 04/01/2023 to 09/01/2023
- Due date changed from 10/31/2023 to 09/30/2024
Updated by Peter Amstutz over 1 year ago
- Start date changed from 09/01/2023 to 01/01/2024
- Due date changed from 09/30/2024 to 03/31/2024
Updated by Peter Amstutz 12 months ago
- Start date changed from 01/01/2024 to 01/01/2025
- Due date changed from 03/31/2024 to 03/31/2025