Commit a2380e02 authored by Enrique Garcia's avatar Enrique Garcia
Browse files

Update doc and relicense

parent 71ced6af
# This software is based on https://gitlab.com/singularityhub/gitlab-ci,
# with DOI: https://doi.org/10.5281/zenodo.3834833
# provided under the following license:
### BSD 3-Clause License
###
### Copyright (c) 2018, Vanessa Sochat
### All rights reserved.
###
### Redistribution and use in source and binary forms, with or without
### modification, are permitted provided that the following conditions are met:
###
### * Redistributions of source code must retain the above copyright notice, this
### list of conditions and the following disclaimer.
###
### * Redistributions in binary form must reproduce the above copyright notice,
### this list of conditions and the following disclaimer in the documentation
### and/or other materials provided with the distribution.
###
### * Neither the name of the copyright holder nor the names of its
### contributors may be used to endorse or promote products derived from
### this software without specific prior written permission.
###
### THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
### AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
### IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
### DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
### FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
### DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
### SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
### CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
### OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
### OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###
stages:
- test
- build
......
BSD 3-Clause License
Copyright (c) 2018, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# .gitlabci
## Building Singularity Containers using the continuous integration in GitLab
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3834833.svg)](https://doi.org/10.5281/zenodo.3834833)
**PLEASE HAVE A LOOK TO THE LICENSING SECTION BELOW BEFORE IMPLEMENTING ANY PART OF THIS CODE INTO YOURS !!**
## Building Singularity Containers using the continuous integration in GitLab
The source code contained in this folder is based on the following
[gitlab-ci repository](https://gitlab.com/singularityhub/gitlab-ci). You can find a very didactic **tutorial** of how
[GitLab-CI repository](https://gitlab.com/singularityhub/gitlab-ci). You can find a very didactic **tutorial** of how
to implement this code [here](https://vsoch.github.io/2018/gitlab-singularity-ci/).
This software (composed of the files within this directory **AND** the `gitlab-ci.yml` file in the
root directory) provide the necessary tools to:
- Use a Singularity image stored in the SingularityHub to create a Singularity Container of your repository
This software (composed of the files within this directory **AND** part of the the `.gitlab-ci.yml` file in the
root directory - the `build_image` stage) provide the necessary tools to:
- Use a Singularity image stored in the DockerHub site to create a Singularity Container of your repository
(thus no need of having installed the Singularity program), and uploaded it directly to your GitLab repository.
- The Singularity receipt must be provided, of course.
- In case the container is too large (10 Gb total storage limit for a single GitLab project), you must pass
through a cloud service (various examples of different services are shown in the tutorial and the original repository).
## License of the repository
The license of the 'parent' repository is `BSD 3-Clause License` ("BSD License 2.0", "Revised BSD License", "New BSD
License", or "Modified BSD License"). Before implementing anything from the current or the original repository
**please check that the license of the project in which you are going to implement these source files is compatible
with BSD 3-Clause**.
If this is the case, each file (based on or modified from its original) MUST contain the license below:
> BSD 3-Clause License
>
> Copyright (c) 2018, Vanessa Sochat
> All rights reserved.
>
> Redistribution and use in source and binary forms, with or without
> modification, are permitted provided that the following conditions are met:
>
> * Redistributions of source code must retain the above copyright notice, this
> list of conditions and the following disclaimer.
>
> * Redistributions in binary form must reproduce the above copyright notice,
> this list of conditions and the following disclaimer in the documentation
> and/or other materials provided with the distribution.
>
> * Neither the name of the copyright holder nor the names of its
> contributors may be used to endorse or promote products derived from
> this software without specific prior written permission.
>
> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
> FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
### Specific case of the `template_project_repository`:
## License of the `template_project_repository`:
The `template_project_repository` contains code from different projects. This 'mixing' can be done because:
- Both 'parent' projects are Open Source.
- Both licenses, `BSD 3-Clause` and `GPLv3`, are [compatible](
https://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean); this means that source code distributed with a BSD
3-Clause license can be included within a project with a GPLv3 license:
- Note however that the GNU General Public License v3 is 'copyleft', meaning that the resulting project from the use
of any code licensed with GPLv3, must be distributed with the same license, thus GPLv3.
This are the reasons why the `template_project_repository` is distributed with the GNU General Public License Version
3 and some files contain a BSD-3 Clause license.
- None of the original licenses are copy-left.
- Both `BSD 3-Clause` and `MIT`, are permissive licenses. All of these points mean that source code distributed with
a BSD 3-Clause license can be included in a project with a MIT license - and of course be re-distributed under `MIT`:
- Note however, that the **original licenses** must be included in the resulting project and mentioned in the
LICENSE/documentation files.
**PLEASE TAKE THE TIME TO CHECK AND VERIFY LICENSES AND THEIR COMPATIBILITIES**
\ No newline at end of file
MIT License
Copyright (c) 2020, ZenodoCI developers.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -4,81 +4,54 @@
## Continuous Deployment to Zenodo
The source code contained in this folder is based on the
[zenodo-python repository](https://github.com/SiLeBAT/zenodo-python).
The source code contained in this folder is based on the [ZenodoCI](https://gitlab.in2p3.fr/escape2020/escape/zenodoci)
project. The library was developed specifically to perform a deploy stage (to the Zenodo repository) in a GitLab CI
pipeline that **could be implemented in any external project**.
The software (composed of the `zenodolib.py` script) provides a library to handle the upload of a
specified file(s) to (sandbox)zenodo. Please **JUST** upload stable versions/releases of source code and/or images
The library (composed of the scripts within the `.zenodoci` directory) provides a module to handle the upload of
specified file(s) to (sandbox)zenodo. Please **JUST** upload stable versions/releases of source code and/or image
containers!
By using the `zenodolib` library, as well as the created Singularity container (check the `.gitlabci` directory),
the second stage of the CI pipeline (see the `.gitlab-ci.yml` file) will:
The `deploy` stage in the CI pipeline (see the `.gitlab-ci.yml` file) will make use of the `zenodoapi` library and
the built Singularity container created in the previous CI stage (check the `.gitlabci` directory too) to:
- Either upload the desired file(s) to the ESCAPE community in Zenodo.
- Either upload a new version of an existing entry to Zenodo.
The `repository_information.json` file must be filled up before pushing to the project repository. Also, depending on
the case, the corresponding python script (`upload_new_deposit.py` or `upload_new_version_of_deposit.py`) must be
adapted and included into the `.gitlab-ci.yml` file with its corresponding arguments.
The `repository_information.json` file must be filled up before pushing to the GitLab repository. This file will be
used to fill up the compulsory information that a Zenodo entry must contain. Also, depending on the case, the
corresponding python script (`upload_new_deposit.py` or `upload_new_version_of_deposit.py`) must be adapted and
included into the `.gitlab-ci.yml` file with its corresponding arguments (examples are shown in the yml file).
### Zenodo token & GitLab CI environment variable
To connect the GitLab repository with Zenodo in an autonomous way, a personal access token must be created. This token
is assign to a **single** Zenodo account, and it will allow to interact with (sandbox)zenodo through its
API. To create the token:
is assigned to a **single** Zenodo account, and it will allow the interaction with
(sandbox.)zenodo through its API. To create the token:
- Go to (sandbox)zenodo.org
- Account --> Applications --> Personal access token --> New token.
This token will be passed later in the continuous deployment stage of the CI/CD pipeline. For not sharing publicly
your personal token, you should create an environment variable in your GitLab repository. This way, the token could be used as a variable without
revealing its value. To create an an environment variable:
This token will be passed later in the deployment stage of the CI pipeline. For not sharing publicly
your personal token, you should create an environment variable in your GitLab repository. This way, the token could be
used as a variable without revealing its value. To create an an environment variable:
- Go to your GitLab repository.
- Settings --> CI/CD --> Variables --> Add variable --> Fill the fields --> Mask your variable(s) !!
The environment variable will look like this:
```sh
$ python .zenodoci/upload_new_deposit.py -i build/Singularity -t $ZENODO_TOKEN
$ python .zenodoci/upload_new_deposit.py -i build -t $ZENODO_TOKEN -s False
```
## License of the repository
The license of the 'parent' repository is `GNU GENERAL PUBLIC LICENSE Version 3` ("GNU GPL v3" or "GPLv3"). Before
implementing anything from the current or the original repository **please check that the license of the project
in which you are going to implement these source files is compatible with the GPLv3 license**.
If this is the case:
- The whole resulting project must be distributed with the same license, i.e., `GPLv3` and contain the license
and copyright notice (see the LICENSE file of the `template_project_repository`). GPLv3 is copyleft.
- Changes must be stated (here is an example of the kind of text that must be included in each modified file):
> This code is part of https://github.com/SiLeBAT/zenodo-python
>
> Copyright (c) 2015 Federal Institute for Risk Assessment (BfR), Germany
> This program is free software: you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation, either version 3 of the License, or
> (at your option) any later version.
>
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> along with this program. If not, see <http://www.gnu.org/licenses/>.
### Specific case of the `template_project_repository`:
## License of the `template_project_repository`:
The `template_project_repository` contains code from different projects. This 'mixing' can be done because:
- Both 'parent' projects are Open Source.
- Both licenses, `BSD 3-Clause` and `GPLv3`, are [compatible](
https://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean); this means that source code distributed with a BSD
3-Clause license can be included within a project with a GPLv3 license:
- Note however that the GNU General Public License v3 is 'copyleft', meaning that the resulting project from the use
of any code licensed with GPLv3, must be distributed with the same license, thus GPLv3.
This are the reasons why the `template_project_repository` is distributed with the GNU General Public License Version
3 and some files contain a BSD-3 Clause license.
- None of the original licenses are copy-left.
- Both `BSD 3-Clause` and `MIT`, are permissive licenses. All of these points mean that source code distributed with
a BSD 3-Clause license can be included in a project with a MIT license - and of course be re-distributed under `MIT`:
- Note however, that the **original licenses** must be included in the resulting project and mentioned in the
LICENSE/documentation files.
**PLEASE TAKE THE TIME TO CHECK AND VERIFY LICENSES AND THEIR COMPATIBILITIES**
\ No newline at end of file
......@@ -3,7 +3,7 @@ import os
import json
import argparse
from distutils.util import strtobool
from .zenodoapi import ZenodoAPI
from zenodoapi import ZenodoAPI
parser = argparse.ArgumentParser(description="Upload new deposit entry to Zenodo")
......
......@@ -3,7 +3,7 @@ import os
import json
import argparse
from distutils.util import strtobool
from .zenodoapi import ZenodoAPI
from zenodoapi import ZenodoAPI
parser = argparse.ArgumentParser(description="Upload a new version of an existing deposit to Zenodo")
......
This diff is collapsed.
......@@ -27,11 +27,11 @@ The repository shows the **basic documentation** that should be included within
It would be highly suitable to include too:
- A setup file as well as the basic commands to install the library (see below).
- A .gitignore file.
- A `.gitignore` file.
- Unitary and integration tests, and ideally a CI pipeline.
**Please feel free to copy / base on / template this project!** (Look to left of the `Clone or download` button in the
[GitHub](https://github.com/garciagenrique/template_project_escape) site).
**Please feel free to clone / fork / template this project!** (For example, look to left of the
`Clone or download` button in the [GitHub](https://github.com/garciagenrique/template_project_escape) site).
Take few minutes to check the [ESCAPE repository's guidelines](https://gitlab.in2p3.fr/escape2020/guidelines) too.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment