Skip to content

Commit

Permalink
update dockerfile base (#421)
Browse files Browse the repository at this point in the history
* update dockerfile base
* also using default models JsonField and setting default autofield
* pin django 4.2

Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch authored Apr 6, 2023
1 parent a4b0bf0 commit 2fdfc1f
Show file tree
Hide file tree
Showing 276 changed files with 1,946 additions and 1,969 deletions.
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@
}
],
"contributorsPerLine": 7
}
}
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# defined here or within the CircleCI settings. The following environment
# variables are acceptable here or in these settings (for sensitive information)
#
# CONTAINER_NAME if not set, will use Github repo and organization name
# CONTAINER_NAME if not set, will use Github repo and organization name
# DOCKER_USER
# DOCKER_EMAIL
# Dockerfile optional, if the path is different than the Dockerfile in $PWD
Expand All @@ -30,7 +30,7 @@ install: &install

sourceenv: &sourceenv
name: Source environment variables from the BASH_ENV
command: source $BASH_ENV
command: source $BASH_ENV


# Docker
Expand Down Expand Up @@ -67,7 +67,7 @@ dockerenv: &dockerenv
dockerload: &dockerload
name: Load Docker container Image
no_output_timeout: 30m
command: |
command: |
echo "Working directory is ${PWD}"
docker info
set +o pipefail
Expand Down Expand Up @@ -128,7 +128,7 @@ dockernginx: &dockernginx
name: Build nginx custom container
command: |
source ${BASH_ENV}
echo "Building ${CONTAINER_NAME}_nginx:${DOCKER_TAG}"
echo "Building ${CONTAINER_NAME}_nginx:${DOCKER_TAG}"
cd ${REPO_NAME}/nginx && \
ls && \
docker build -f ${DOCKERFILE} -t ${CONTAINER_NAME}_nginx:${DOCKER_TAG} .
Expand Down Expand Up @@ -196,7 +196,7 @@ workflows:
- build:
filters:
branches:
ignore:
ignore:
- gh-pages
- /docs?/.*/
- contributors/*
Expand All @@ -208,7 +208,7 @@ workflows:
- build
filters:
branches:
ignore:
ignore:
- gh-pages
- /docs?/.*/
- contributors/*
Expand Down
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ all your interactions with the project members and users.
4. The project's default copyright and header have been included in any new
source files.
5. All (major) changes to Singularity Registry must be documented in
[docs](docs). If your PR changes a core functionality, please
include clear description of the changes in your PR so that the docs
[docs](docs). If your PR changes a core functionality, please
include clear description of the changes in your PR so that the docs
can be updated, or better, submit another PR to update the docs directly.
6. If necessary, update the README.md.
7. The pull request will be reviewed by others, and the final merge must be
Expand Down Expand Up @@ -98,7 +98,7 @@ an incident. Further details of specific enforcement policies may be posted
separately.

Project maintainers, contributors and users who do not follow or enforce the
Code of Conduct in good faith may face temporary or permanent repercussions
Code of Conduct in good faith may face temporary or permanent repercussions
with their involvement in the project as determined by the project's leader(s).

## Attribution
Expand Down
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ name: Question
about: What's on your mind?

---


Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ name: Request for Documentation or Tutorial
about: request improvements or changes to docs or a tutorial

---


4 changes: 4 additions & 0 deletions .github/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pre-commit
black
isort
flake8
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ jobs:
- uses: actions/checkout@v1

- name: Check for typos in docs
uses: crate-ci/typos@592b36d23c62cb378f6097a292bc902ee73f93ef # version 1.0.4
with:
files: ./docs ./README.md
uses: crate-ci/typos@7ad296c72fa8265059cc03d1eda562fbdfcd6df2 # v1.9.0
with:
files: ./docs/_docs ./docs/_posts ./README.md

- name: Setup black linter
run: conda create --quiet --name black black

- name: Lint python code
- name: Lint and format Python code
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate black
black --check shub
pip install -r .github/dev-requirements.txt
pre-commit run --all-files
4 changes: 2 additions & 2 deletions .github/workflows/update-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Tributors Update

# Important! Update to release https://github.com/con/tributors
uses: con/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
with:

# Single text list (space separated) of parsers, leave unset to auto-detect
parsers: unset
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Gemfile.lock
sregistry
_site
minio-images
env

# Other #
#########
Expand Down
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
exclude: "(.all-contributorsrc|static)"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending

- repo: local
hooks:
- id: black
name: black
language: python
types: [python]
entry: black

- id: isort
name: isort
args: [--filter-files]
language: python
types: [python]
entry: isort

- id: flake8
name: flake8
language: python
types: [python]
entry: flake8
2 changes: 1 addition & 1 deletion .tributors
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@
"affiliation": "Fraunhofer-Institut für Zelltherapie und Immunologie",
"blog": "https://github.com/SethosII"
}
}
}
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# CHANGELOG

This is a manually generated log to track changes to the repository for each release.
Each section should include general headers such as **Implemented enhancements**
and **Merged pull requests**. All closed issued and bug fixes should be
This is a manually generated log to track changes to the repository for each release.
Each section should include general headers such as **Implemented enhancements**
and **Merged pull requests**. All closed issued and bug fixes should be
represented by the pull requests that fixed them. Critical items to know are:

- renamed commands
Expand All @@ -12,11 +12,12 @@ represented by the pull requests that fixed them. Critical items to know are:


## [master](https://github.com/singularityhub/sregistry/tree/master) (master)
- update to use Django 4.2 (2.1.0)
- consolidate config into one file with environment (2.0.0)
- This is an API breaking change, as the settings are completely refactored
- update python base to 3.9, minio server to use new credentials (1.1.4)
- docker-compose updated to use docker compose
- add: auto set "verify" attribute of s3 and s3_external obj in minio.py for SSL use (1.1.39)
- add: auto set "verify" attribute of s3 and s3_external obj in minio.py for SSL use (1.1.39)
- fix issues with psycopg2-binary and saml auth (1.1.38)
- Pin psycopg2-binary 2.8.6 to deal with UTC errors
- change formatting of the login URL to fix saml auth
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.9
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
ENV MESSAGELEVEL QUIET
ENV DEBIAN_FRONTEND=noninteractive
ENV MESSAGELEVEL=QUIET

ARG ENABLE_LDAP=false
ARG ENABLE_PAM=false
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@

## What is Singularity Registry

Singularity Registry Server is a server to provide management and storage of
Singularity images for an institution or user to deploy locally.
It does not manage building but serves endpoints to obtain and save containers.
Singularity Registry Server is a server to provide management and storage of
Singularity images for an institution or user to deploy locally.
It does not manage building but serves endpoints to obtain and save containers.

## Images Included

Singularity Registry consists of several Docker images, and they are integrated
Singularity Registry consists of several Docker images, and they are integrated
to work together using [docker-compose.yml](docker-compose.yml).

The images are the following:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
- ./static:/var/www/static
- ./images:/var/www/images
# uncomment for PAM auth
#- /etc/passwd:/etc/passwd
#- /etc/passwd:/etc/passwd
#- /etc/shadow:/etc/shadow
links:
- minio
Expand Down Expand Up @@ -73,11 +73,12 @@ services:
- db

minio:
image: minio/minio
# https://min.io/docs/minio/linux/operations/install-deploy-manage/migrate-fs-gateway.html
image: minio/minio:RELEASE.2022-08-02T23-59-16Z
volumes:
- ./minio-images:/images
env_file:
- ./.minio-env
ports:
- "9000:9000"
- "9000:9000"
command: ["server", "images"]
6 changes: 3 additions & 3 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Changelog

This is a manually generated log to track changes to the repository for each release.
Each section should include general headers such as **Implemented enhancements**
and **Merged pull requests**. All closed issued and bug fixes should be
This is a manually generated log to track changes to the repository for each release.
Each section should include general headers such as **Implemented enhancements**
and **Merged pull requests**. All closed issued and bug fixes should be
represented by the pull requests that fixed them.
Critical items to know are:

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd docs
### 2. Customize

To edit configuration values, customize the [_config.yml](_config.yml).
To add pages, write them into the [pages](pages) folder.
To add pages, write them into the [pages](pages) folder.
You define urls based on the `permalink` attribute in your pages,
and then add them to the navigation by adding to the content of [_data/toc.myl](_data/toc.yml).

Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/accounts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permalink: docs/accounts/

Singularity Registry server creates user accounts by way of login with OAuth2, and
then interaction with the API via user specific tokens. These sections describe
how to generate accounts, teams, as well as robot users for interacting with
how to generate accounts, teams, as well as robot users for interacting with
continuous integration.

- [credentials](credentials): overview of basic accounts and credentials
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/accounts/credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ docker exec $NAME python /code/manage.py add_superuser --username vsoch
docker exec $NAME python /code/manage.py add_admin --username vsoch
```

You will want to go to [http://127.0.0.1/token](http://127.0.0.1/token) and use the contents of the json object to define the necessary environment variabes.
You will want to go to [http://127.0.0.1/token](http://127.0.0.1/token) and use the contents of the json object to define the necessary environment variables.

{% include alert.html title="Important!" content="You must be a superuser <strong>and</strong> admin to build images." %}

Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/accounts/robots.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ collection.save()
```

As an alternative, if you intend to add this robot user to more than one collection,
you can create a [Team]({{ site.url }}{{ site.baseurl }}/docs/setup/teams) in the interface,
you can create a [Team]({{ site.url }}{{ site.baseurl }}/docs/setup/teams) in the interface,
add the robot user to it also via the console:

```python
Expand Down
18 changes: 9 additions & 9 deletions docs/_docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ toc: false

## Singularity Pull

Singularity Registry Server implements a basic version of the Sylabs Library API,
meaning that you can pull a container with Singularity directly.
Singularity Registry Server implements a basic version of the Sylabs Library API,
meaning that you can pull a container with Singularity directly.

**Important** you must be using Singularity 3.3.0 or greater for this to work!
**Important** you must be using Singularity 3.3.0 or greater for this to work!
If not, you should use [Singularity Registry Client](#singularity-registry-client)
(which also has examples below of using the `shub://` endpoint with singularity).

Expand Down Expand Up @@ -90,7 +90,7 @@ And then provide it (via copy paste) to the Singularity client to create a remot
$ singularity remote login DinosaurCloud
Generate an access token at http://127.0.0.1/auth/tokens, and paste it here.
Token entered will be hidden for security.
Access Token:
Access Token:
INFO: Access Token Verified!
INFO: Token stored in /home/vanessa/.singularity/remote.yaml
```
Expand All @@ -101,7 +101,7 @@ If you paste a token that isn't valid, you'll get a different message
$ singularity remote login DinosaurCloud
INFO: Authenticating with remote: DinosaurCloud
Generate an API Key at https://127.0.0.1/auth/tokens, and paste here:
API Key:
API Key:
FATAL: while verifying token: error response from server: Invalid Token
```
Expand Down Expand Up @@ -138,7 +138,7 @@ $ singularity remote use DinosaurCloud
Now that we have a token, let's try a push! For security purposes, the collection
should already exist, and be owned by you. Collaborators are not allowed to push.
```bash
```bash
# library://user/collection/container[:tag]
$ singularity push -U busybox_latest.sif library://vsoch/dinosaur-collection/another:latest
```
Expand Down Expand Up @@ -245,7 +245,7 @@ Not shown in the demo above is the pull command, but it does the same thing as t
```bash
sregistry pull banana/pudding:milkshake
Progress |===================================| 100.0%
Progress |===================================| 100.0%
Success! banana-pudding-milkshake.img
```
Expand Down Expand Up @@ -342,7 +342,7 @@ sregistry labels --key maintainer --value vanessasaur
# Curl
Like with the Sylabs Library API, it is possible to interact with Singularity Registry Server
Like with the Sylabs Library API, it is possible to interact with Singularity Registry Server
using Curl. You can browse the API schema via the `/api` path of your server.
## Authentication
Expand Down Expand Up @@ -400,7 +400,7 @@ a POST request to the endpoint `/v1/collections` and this json payload:
Here is an example with our user id of 1:
```bash
$ curl -X POST -H 'Authorization: Bearer <token>' -H "Content-Type: application/json" --data '{"entity": 1, "name": "dinosaurs"}' http://127.0.0.1/v1/collections
$ curl -X POST -H 'Authorization: Bearer <token>' -H "Content-Type: application/json" --data '{"entity": 1, "name": "dinosaurs"}' http://127.0.0.1/v1/collections
```
You can then see the response that the collection was created, and it will appear in the interface:
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/deploy/ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ Once you have completed all the configuration of the role in your recipe, it is
sudo ansible-playbook sregistry.yml
```

Want to learn more? Check out the [official documentation](https://github.com/grycap/ansible-role-singularity-registry)
Want to learn more? Check out the [official documentation](https://github.com/grycap/ansible-role-singularity-registry)
for the entire story.
Loading

0 comments on commit 2fdfc1f

Please sign in to comment.