Page MenuHomeSoftware Heritage

api/server: Allow noop objstorage to be used in development mode
AbandonedPublic

Authored by ardumont on Dec 7 2021, 11:13 AM.

Details

Reviewers
None
Group Reviewers
Reviewers
Summary

Providing the SWH_DEV_ENVIRONMENT is set, allow to actually use the noop objstorage.
This can be useful for example in docker environment.

Test Plan

tox

Diff Detail

Repository
rDOBJS Object storage
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25414
Build 39728: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 39727: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D6759 (id=24540)

Rebasing onto b7adf3823c...

Current branch diff-target is up to date.
Changes applied before test
commit 63330f48f765c587c05d06b0fcfd55eac6c4e579
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Dec 7 11:11:04 2021 +0100

    api/server: Allow noop objstorage to be used in development mode
    
    Providing the SWH_DEV_ENVIRONMENT is set, allow to actually use the noop objstorage.
    This can be useful for example in docker environment.

See https://jenkins.softwareheritage.org/job/DOBJS/job/tests-on-diff/71/ for more details.

swh/objstorage/api/server.py
240

feel free to propose me some better name, i usually fall short...
maybe SWH_BYPASS_CHECK is fine enough?

I don't think you should add these checks. We also don't check the in-mem objstorage backend, and it loses data just as much as this one.

I don't think you should add these checks. We also don't check the in-mem objstorage backend, and it loses data just as much as this one.

We are not consistent indeed. Like i said in the description, some are tested some are not [1]
I'm fine either way but it'd be best to decide and conclude then stay consistent afterwards.

[1] https://forge.softwareheritage.org/source/swh-scheduler/browse/master/swh/scheduler/api/server.py$0-115

It's more trouble than it's worse IMO. "noop" needs to be explicitly written in config files, so I think it's unlikely to happen by accident.

It's more trouble than it's worse IMO. "noop" needs to be explicitly written in config files, so I think it's unlikely to happen by accident.

Opened D6780 to follow through the conclusion.