Skip to content

Commit 8f321f5

Browse files
committed
Replace with v2 refactor
1 parent 372fec9 commit 8f321f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4390
-2637
lines changed

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
description: The reference to build
8+
type: string
9+
required: true
10+
image:
11+
description: The name of the image to build
12+
type: string
13+
required: true
14+
context:
15+
description: The context used to build the image
16+
type: string
17+
required: true
18+
stage:
19+
description: The stage to build
20+
type: string
21+
required: false
22+
dockerfile:
23+
description: The path to the Dockerfile
24+
type: string
25+
required: false
26+
outputs:
27+
image-id:
28+
description: The ID of image that has been built
29+
value: ${{ jobs.build.outputs.image-id }}
30+
31+
jobs:
32+
build:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
image-id: ${{ steps.build.outputs.image-id }}
36+
steps:
37+
- name: Checkout Code
38+
uses: actions/checkout@v4
39+
with:
40+
ref: ${{ inputs.ref }}
41+
42+
- id: build
43+
name: Build and push
44+
uses: cern-sis/gh-workflows/.github/actions/[email protected]
45+
with:
46+
image: ${{ inputs.image }}
47+
context: ${{ inputs.context }}
48+
stage: ${{ inputs.stage }}
49+
dockerfile: ${{ inputs.dockerfile }}
50+
registry: registry.cern.ch
51+
cache: false
52+
tags: |
53+
type=ref,event=branch
54+
type=ref,event=pr
55+
type=ref,event=tag
56+
username: ${{ secrets.HARBOR_USERNAME }}
57+
password: ${{ secrets.HARBOR_SECRET }}

.github/workflows/pre-commit.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pre-Commit
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
description: The reference to build
8+
type: string
9+
required: true
10+
11+
jobs:
12+
linter:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ inputs.ref }}
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.11"
24+
25+
- name: Run pre-commit
26+
uses: pre-commit/[email protected]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Pull request master
2+
3+
on:
4+
pull_request_target:
5+
branches: [master]
6+
7+
jobs:
8+
pre-commit:
9+
uses: ./.github/workflows/pre-commit.yml
10+
with:
11+
ref: ${{ github.event.pull_request.head.sha }}
12+
secrets: inherit

.github/workflows/push-master.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Push master
2+
3+
on: workflow_dispatch
4+
# push:
5+
# branches: [master]
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
build:
13+
uses: ./.github/workflows/build.yml
14+
with:
15+
ref: ${{ inputs.ref }}
16+
image: cern-sis/inspire/classifier
17+
context: .
18+
secrets: inherit
19+
20+
deploy:
21+
needs: build
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: send event
25+
uses: cern-sis/gh-workflows/.github/actions/[email protected]
26+
with:
27+
event-type: update
28+
images: |
29+
cern-sis/inspire/classifier@${{ needs.build.outputs.image-id }}
30+
token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES }}

.gitignore

Lines changed: 93 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
#
3-
# This file is part of INSPIRE.
4-
# Copyright (C) 2014-2018 CERN.
5-
#
6-
# INSPIRE is free software: you can redistribute it and/or modify
7-
# it under the terms of the GNU General Public License as published by
8-
# the Free Software Foundation, either version 3 of the License, or
9-
# (at your option) any later version.
10-
#
11-
# INSPIRE is distributed in the hope that it will be useful,
12-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
# GNU General Public License for more details.
15-
#
16-
# You should have received a copy of the GNU General Public License
17-
# along with INSPIRE. If not, see <http://www.gnu.org/licenses/>.
18-
#
19-
# In applying this license, CERN does not waive the privileges and immunities
20-
# granted to it by virtue of its status as an Intergovernmental Organization
21-
# or submit itself to any jurisdiction.
22-
231
# Byte-compiled / optimized / DLL files
242
__pycache__/
253
*.py[cod]
@@ -30,7 +8,6 @@ __pycache__/
308

319
# Distribution / packaging
3210
.Python
33-
env/
3411
build/
3512
develop-eggs/
3613
dist/
@@ -42,9 +19,12 @@ lib64/
4219
parts/
4320
sdist/
4421
var/
22+
wheels/
23+
share/python-wheels/
4524
*.egg-info/
4625
.installed.cfg
4726
*.egg
27+
MANIFEST
4828

4929
# PyInstaller
5030
# Usually these files are written by a python script from a template
@@ -59,14 +39,17 @@ pip-delete-this-directory.txt
5939
# Unit test / coverage reports
6040
htmlcov/
6141
.tox/
42+
.nox/
6243
.coverage
6344
.coverage.*
6445
.cache
6546
nosetests.xml
6647
coverage.xml
67-
*,cover
48+
*.cover
49+
*.py,cover
6850
.hypothesis/
6951
.pytest_cache/
52+
cover/
7053

7154
# Translations
7255
*.mo
@@ -75,63 +58,111 @@ coverage.xml
7558
# Django stuff:
7659
*.log
7760
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
7863

79-
# Flask instance folder
64+
# Flask stuff:
8065
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
8170

8271
# Sphinx documentation
8372
docs/_build/
84-
docs/_api/
8573

8674
# PyBuilder
75+
.pybuilder/
8776
target/
8877

89-
# IPython Notebook
78+
# Jupyter Notebook
9079
.ipynb_checkpoints
9180

92-
# pyenv
93-
.python-version
94-
95-
# Eclipse/PyDev
96-
.project
97-
.pydevproject
98-
99-
# Git merge backup files
100-
*.orig
81+
# IPython
82+
profile_default/
83+
ipython_config.py
10184

102-
# Linux backup files
103-
*~
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
104130

105-
# Mac folder attributes
106-
.DS_Store
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
107134

108-
# Locally installed node modules
109-
node_modules
135+
# Rope project settings
136+
.ropeproject
110137

111-
# IntelliJ IDE
112-
.idea
138+
# mkdocs documentation
139+
/site
113140

114-
# Redis
115-
dump.rdb
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
116145

117-
# KDevelop4
118-
.kdev4/
119-
*.kdev4
120-
*.kate-swp
146+
# Pyre type checker
147+
.pyre/
121148

122-
# Vim swapfiles
123-
.*.sw?
149+
# pytype static type analyzer
150+
.pytype/
124151

125-
# Selenium report
126-
assets
127-
selenium-report.html
152+
# Cython debug symbols
153+
cython_debug/
128154

129-
# Rope project files
130-
.ropeproject/
155+
# PyCharm
156+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158+
# and can be added to the global gitignore or merged into this file. For a more nuclear
159+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160+
#.idea/
131161

132-
# Twisted
133-
twistd.pid
162+
# Ignore all dataset files
163+
*.pkl
164+
*.df
165+
*.csv
166+
*.h5
134167

135-
# Build artifacts
136-
AUTHORS
137-
CHANGELOG
168+
!/tests/integration/fixtures/inspire_test_data.df

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: '24.4.2'
4+
hooks:
5+
- id: black
6+
- repo: https://github.com/pycqa/isort
7+
rev: '5.13.2'
8+
hooks:
9+
- id: isort
10+
- repo: https://github.com/pycqa/flake8
11+
rev: '7.1.0'
12+
hooks:
13+
- id: flake8
14+
args: ['--config=setup.cfg']

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)