Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation using Perun dumps and capabilities #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .copyright.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Copyright (C) 2024 CESNET z.s.p.o.

oarepo-oidc-einfra is free software; you can redistribute it and/or
modify it under the terms of the MIT License; see LICENSE file for more
details.
41 changes: 41 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2023 CESNET.
#
# CESNET-OpenID-Remote is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.

root = true

[*]
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# Python files
[*.py]
indent_size = 4
# isort plugin configuration
known_first_party = cesnet_openid_remote
multi_line_output = 2
default_section = THIRDPARTY
skip = .eggs

# RST files (used by sphinx)
[*.rst]
indent_size = 4

# CSS, HTML, JS, JSON, YML
[*.{css,html,js,json,yml}]
indent_size = 2

# Matches the exact files either package.json or .github/workflows/*.yml
[{package.json,.github/workflows/*.yml}]
indent_size = 2

# Dockerfile
[Dockerfile]
indent_size = 4
91 changes: 91 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build and test

on:
workflow_call:
inputs:
oarepo:
description: OARepo version (11, 12, ...)
required: true
default: "12"
type: string

env:
OAREPO_VERSION: ${{ inputs.oarepo }}

jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Show oarepo version
run: |
echo "OAREPO_VERSION: >>>$OAREPO_VERSION<<< >>>${{ inputs.oarepo }}<<<"
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Cache pip
uses: actions/cache@v3
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144

- name: Runs Opensearch
uses: ankane/setup-opensearch@v1
with:
plugins: analysis-icu

- name: Start Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-version: ${{ matrix.redis-version }}

- name: Run tests
run: |
./run-tests.sh


- name: Build package to publish
run: |
.venv/bin/python setup.py sdist bdist_wheel

- name: Freeze packages
run: |
.venv/bin/pip freeze > requirements.txt

- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist

- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: requirements.txt
path: requirements.txt
15 changes: 15 additions & 0 deletions .github/workflows/manual.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Dispatch

on:
workflow_dispatch:
inputs:
oarepo:
description: OARepo version (11, 12, ...)
required: true
default: 12

jobs:
build:
uses: ./.github/workflows/build.yaml
with:
oarepo: ${{ github.event.inputs.oarepo }}
37 changes: 37 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build, test and publish

on: push

permissions:
id-token: write
contents: read

jobs:

build12:
uses: ./.github/workflows/build.yaml
with:
oarepo: "12"

publish:
runs-on: ubuntu-latest
needs: build12
steps:
- name: Use built artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: List files
run: |
ls -la
ls -la dist

- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
68 changes: 68 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# Idea software family
.idea/

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Vim swapfiles
.*.sw?
.venv/
.env

.DS_Store

.perun_passwd
14 changes: 14 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
..
Copyright (C) 2023 CESNET.
CESNET-OpenID-Remote is free software; you can redistribute it and/or
modify it under the terms of the MIT License; see LICENSE file for more
details.

Authors
=======

CESNET OIDC Auth backend for OARepo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add yourself to authors :)

- Miroslav Bauer <bauer@cesnet.cz>
- Juraj Trappl <trappl@cesnet.cz>
13 changes: 13 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
..
Copyright (C) 2023 CESNET.

CESNET-OpenID-Remote is free software; you can redistribute it and/or
modify it under the terms of the MIT License; see LICENSE file for more
details.

Changes
=======

Version 0.1.0 (released TBD)

- Initial public release.
Loading
Loading