Skip to content

opencadc/caom2proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

caom2proxy

image

image

image

Collection of Docker images that proxy data from different data providers mimicking the GET endpoints of a caom2repo service such as the http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops service. It is used primarily to support metadata harvesting into a CAOM2 repository.

Subprojects

  • base: implements the base image that is inherited by all the others
  • alma: implements the image for proxying the ALMA

Development

Here are the steps to create a new image:

1 Create the subproject:

mkdir myproxy
cd myproxy
mkdir tests
mkdir image

2. Create the development python envirnoment requirements. At the minimum, this consists of the pytest package

printf "pytest>=3.6\npytest-cov\nflake8\n" > dev_requirements.txt

3. In the image subdirectory, create the image including the Dockerfile with specific environment, requirements.txt file for the Python environment and collection.py with the specific code (see base for details)

cd image
touch Dockerfile
# edit Dockerfile
touch requirements.txt
# edit requirements.txt
touch collection.py
# edit collection.py
cd ..

4. Create the unit tests in the tests directory. Data files required in the tests are located in tests/data

  1. Run tests
pytest tests
  1. Build and check container (see base for details)
  2. Check the style of the code
flake8 image
flake8 tests

Details on how to implement an image can be found in the base.

To test a project, the environment needs to be set up first, followed by test invocation:

cd <subproject>
pip install -r dev_requirements.txt
pip install -r image/requirements.txt
pytest --cov tests

About

CAOM proxy services to support metadata harvesting

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published