-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* merge in jpl tig and update python libraries * fix upload artifact version * fix pytlint flake pytest * fix pylint * update github actions * update changelog * update pyproject.toml * add in release creation workflow * make develop 0.7.0-alpha.1
- Loading branch information
Showing
17 changed files
with
1,836 additions
and
1,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
name: Release Branch Created | ||
|
||
# Run whenever a ref is created https://docs.github.com/en/actions/reference/events-that-trigger-workflows#create | ||
on: | ||
create | ||
|
||
jobs: | ||
# First job in the workflow builds and verifies the software artifacts | ||
bump: | ||
name: Bump minor version on develop | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# Only run if ref created was a release branch | ||
if: | ||
${{ startsWith(github.ref, 'refs/heads/release/') }} | ||
steps: | ||
# Checks-out the develop branch | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: 'refs/heads/develop' | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.3.2 | ||
- name: Bump minor version | ||
env: | ||
COMMIT_VERSION: ${{ github.ref }} | ||
run: | | ||
# only update the develop branch if were making #.#.0 release | ||
# Get the branch name from the GITHUB_REF environment variable | ||
branch_name=${GITHUB_REF#refs/heads/} | ||
# Extract the last number in the branch name using a regular expression | ||
if [[ $branch_name =~ /([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then | ||
first_number=${BASH_REMATCH[1]} | ||
middle_number=${BASH_REMATCH[2]} | ||
last_number=${BASH_REMATCH[3]} | ||
# Increment the middle number by 1 | ||
incremented_middle_number=$((middle_number + 1)) | ||
# Check if the last number is '0' | ||
if [ "$last_number" == "0" ]; then | ||
update_version=$first_number.$incremented_middle_number.$last_number-alpha.1 | ||
poetry version $update_version | ||
echo "software_version=$update_version" >> $GITHUB_ENV | ||
git config --global user.name 'podaac-tig bot' | ||
git config --global user.email '[email protected]' | ||
git commit -am "/version ${{ env.software_version }}" | ||
git push | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,9 +184,9 @@ jobs: | |
# These are gradle-specific steps for installing the application | ||
- name: Install Software | ||
run: | | ||
pip install setuptools -U \ | ||
pip install pylint \ | ||
pip install pytest \ | ||
pip install setuptools -U | ||
pip install pylint | ||
pip install pytest | ||
poetry install | ||
|
@@ -240,9 +240,8 @@ jobs: | |
# This is where tests go | ||
- name: Run Poetry Tests | ||
run: | | ||
poetry run pylint podaac \ | ||
poetry run flake8 podaac \ | ||
poetry run pytest --help \ | ||
poetry run pylint podaac | ||
poetry run flake8 podaac | ||
poetry run pytest --junitxml=build/reports/pytest.xml --cov=podaac/ --cov-report=html -m "not aws and not integration" tests/ | ||
# poetry run pytest --junitxml=build/reports/pytest.xml --cov=podaac/ --cov-report=xml:build/reports/coverage.xml -m "not aws and not integration" tests/ | ||
|
||
|
@@ -298,7 +297,7 @@ jobs: | |
- name: Upload Release Artifacts | ||
uses: ncipollo/[email protected] | ||
with: | ||
tag: ${{ env.the_version }} | ||
tag: ${{ env.new_version }} | ||
artifacts: "*.zip" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
"""lambda function used for image generation in aws lambda with cumulus""" | ||
|
||
import logging | ||
import os | ||
from cumulus_logger import CumulusLogger | ||
from cumulus_process import Process | ||
|
||
cumulus_logger = CumulusLogger('tig_lambda_message_cleaner') | ||
|
||
|
||
class CMACleaner(Process): | ||
""" | ||
A class to help clean up the CMA message after running tig. | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
|
||
super().__init__(*args, **kwargs) | ||
self.logger = cumulus_logger | ||
|
||
def process(self): | ||
"""Main process to generate images for granules | ||
Returns | ||
---------- | ||
dict | ||
Payload that is returned to the cma which is a dictionary with list of granules | ||
""" | ||
|
||
granules = self.input['granules'] | ||
|
||
for granule in granules: | ||
for file in granule['files']: | ||
if 'description' in file: | ||
del file['description'] | ||
|
||
return self.input | ||
|
||
|
||
def handler(event, context): | ||
"""handler that gets called by aws lambda | ||
Parameters | ||
---------- | ||
event: dictionary | ||
event from a lambda call | ||
context: dictionary | ||
context from a lambda call | ||
Returns | ||
---------- | ||
string | ||
A CMA json message | ||
""" | ||
|
||
# pylint: disable=duplicate-code | ||
levels = { | ||
'critical': logging.CRITICAL, | ||
'error': logging.ERROR, | ||
'warn': logging.WARNING, | ||
'warning': logging.WARNING, | ||
'info': logging.INFO, | ||
'debug': logging.DEBUG | ||
} | ||
logging_level = os.environ.get('LOGGING_LEVEL', 'info') | ||
cumulus_logger.logger.level = levels.get(logging_level, 'info') | ||
cumulus_logger.setMetadata(event, context) | ||
return CMACleaner.cumulus_handler(event, context=context) |
Oops, something went wrong.