Skip to content

Commit

Permalink
Feautre/1323 reorganize branches plat2 (#849)
Browse files Browse the repository at this point in the history
* Update CI plat2

* Update readme title

* Fix piwind branch select

* Updated Package Requirements: pyYaml==5.3.1

* fix

* test CI workflow without CVE error

---------

Co-authored-by: awsbuild <[email protected]>
  • Loading branch information
sambles and awsbuild authored Jul 18, 2023
1 parent 0924689 commit 129fb21
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 59 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name: Platform Schema (OpenAPI)
on:
push:
branches:
- platform-2.0
- platform-2.0-develop
- main
pull_request:
branches:
- platform-2.0
- platform-2.0-develop
- main
workflow_dispatch:
inputs:
ods_branch:
Expand All @@ -24,10 +22,10 @@ on:
jobs:
ods_tools:
if: inputs.ods_branch != ''
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@develop
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@main
secrets: inherit
with:
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'develop' || inputs.ods_branch }}
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'main' || inputs.ods_branch }}

schema:
if: ${{ ! failure() || ! cancelled() }}
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

piwind_branch:
description: 'Branch to build piwind from'
default: 'develop'
default: 'main'
required: true

prev_release_tag:
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:


build_piwind:
uses: OasisLMF/OasisPiWind/.github/workflows/build.yml@master
uses: OasisLMF/OasisPiWind/.github/workflows/build.yml@main
secrets: inherit
needs: build_images
with:
Expand Down Expand Up @@ -114,16 +114,16 @@ jobs:
dir_ktools: ${{ github.workspace }}/ktools

branch_platform: ${{ github.ref_name }}
branch_oasislmf: 'master'
branch_ods_tools: 'master'
branch_ktools: 'master'
branch_oasislmf: 'main'
branch_ods_tools: 'main'
branch_ktools: 'main'

steps:
## RELEASE CHECKS
- name: check branchname is valid for release
if: ${{ !startsWith(github.ref_name , 'release/') && !startsWith(github.ref_name, 'backports/') }}
if: ${{ !startsWith(github.ref_name , 'release/') && !startsWith(github.ref_name, 'stable/') }}
run: |
echo "Releases must be trigged on branchs 'release/x.x.x' or 'backports/x.x.x' "
echo "Releases must be trigged on branchs 'release/x.x.x' or 'stable/x.x.x' "
exit 1
- name: Check tag is valid for release
Expand All @@ -144,8 +144,8 @@ jobs:
exit 1
fi
- name: set Oasislmf to backports
if: startsWith(github.ref_name, 'backports/')
- name: set Oasislmf to stable
if: startsWith(github.ref_name, 'stable/')
run: echo "branch_oasislmf=${{ env.branch_platform }}" >> $GITHUB_ENV

## CLONE REPOS (plat / oasislmf / ktools / UI)
Expand Down Expand Up @@ -448,7 +448,7 @@ jobs:
docker push coreoasis/piwind_worker:${{ env.release_tag }}
#- name: Push images (Production)
# if: ${{ env.pre_release == 'false' && !startsWith(github.ref_name, 'backports/') }}
# if: ${{ env.pre_release == 'false' && !startsWith(github.ref_name, 'stable/') }}
# run: |
# docker push coreoasis/api_server:latest
# docker push coreoasis/model_worker:latest
Expand Down Expand Up @@ -504,7 +504,7 @@ jobs:
# --- Notify Slack --- #
slack:
uses: OasisLMF/OasisLMF/.github/workflows/notify.yml@master
uses: OasisLMF/OasisLMF/.github/workflows/notify.yml@main
secrets: inherit
needs: release
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scan-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: External Vulnerability Scanning
on:
push:
branches:
- platform-2.0
- main
pull_request:
branches:
- platform-2.0
- main

workflow_dispatch:
inputs:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name: Platform Vulnerability Scanning
on:
push:
branches:
- platform-2.0
- platform-2.0-develop
- main
pull_request:
branches:
- platform-2.0
- platform-2.0-develop
- main
schedule:
- cron: '0 */6 * * *' # Run scan every 6 hours

Expand Down
49 changes: 21 additions & 28 deletions .github/workflows/test-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ name: Platform Image Tests
on:
push:
branches:
- platform-2.0
- platform-2.0-develop

- main
pull_request:
branches:
- platform-2.0
- platform-2.0-develop

- main
workflow_dispatch:
inputs:
last_release:
Expand All @@ -19,7 +15,7 @@ on:
piwind_branch:
description: "Check Results from Piwind branch [git ref]"
required: true
default: 'develop'
default: 'main'
pytest_options:
description: "Pytest optional args [-k <test_name>]"
required: false
Expand All @@ -45,9 +41,10 @@ jobs:
with:
docker_push: true
ignore_unfixed: true
cve_severity: ${{ github.event_name != 'workflow_dispatch' && 'CRITICAL,HIGH' || inputs.cve_severity }}
oasislmf_branch: ${{ github.event_name != 'workflow_dispatch' && 'develop' || inputs.oasislmf_branch }}
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'develop' || inputs.ods_branch }}
#cve_severity: ${{ github.event_name != 'workflow_dispatch' && 'CRITICAL,HIGH' || inputs.cve_severity }}
cve_severity: ${{ github.event_name != 'workflow_dispatch' && 'SKIP' || inputs.cve_severity }}
oasislmf_branch: ${{ github.event_name != 'workflow_dispatch' && 'main' || inputs.oasislmf_branch }}
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'main' || inputs.ods_branch }}

setup:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -89,23 +86,19 @@ jobs:
- name: Select PiWind branch
id: piwind
run: |
# Select matching base branch on piwind
if [[ "${{ github.event_name }}" = "pull_request" ]]; then
#BRANCH=${{ github.base_ref }}
if [[ "${{ github.base_ref }}" = 'platform-2.0' ]]; then
BRANCH=master
else
BRANCH=develop
fi
BRANCH=${{ github.base_ref }}
elif [[ "${{ github.event_name }}" = "push" ]]; then
#BRANCH=${{ github.ref_name }}
if [[ "${{ github.base_ref }}" = 'platform-2.0' ]]; then
BRANCH=master
else
BRANCH=develop
fi
BRANCH=${{ github.ref_name }}
else
BRANCH=${{ inputs.piwind_branch }}
fi
fi
#override 'main-platform1' -> 'main'
if [[ "$BRANCH" = 'main-platform1' ]]; then
BRANCH=main
fi
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -141,7 +134,7 @@ jobs:
name: PiWind all checks
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@develop
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: ${{ needs.setup.outputs.build_server_img }}
Expand All @@ -156,7 +149,7 @@ jobs:
name: Worker Debian
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@develop
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: ${{ needs.setup.outputs.build_server_img }}
Expand All @@ -171,7 +164,7 @@ jobs:
# name: Server Compatibility (${{ needs.setup.outputs.release_tag }})
# secrets: inherit
# needs: [setup]
# uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@develop
# uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
# with:
# piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
# server_image: ${{ needs.setup.outputs.build_server_img }}
Expand All @@ -186,7 +179,7 @@ jobs:
# name: Worker Compatibility (${{ needs.setup.outputs.release_tag }})
# secrets: inherit
# needs: [setup]
# uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@develop
# uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
# with:
# piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
# server_image: 'coreoasis/api_server'
Expand All @@ -201,7 +194,7 @@ jobs:
# name: Storage Compatibility (S3)
# secrets: inherit
# needs: [setup]
# uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@develop
# uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
# with:
# piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
# server_image: ${{ needs.setup.outputs.build_server_img }}
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name: Platform Python Tests
on:
push:
branches:
- platform-2.0
- platform-2.0-develop
- main
pull_request:
branches:
- platform-2.0
- platform-2.0-develop
- main
workflow_dispatch:
inputs:
ods_branch:
Expand All @@ -18,10 +16,10 @@ on:
jobs:
ods_tools:
#if: inputs.ods_branch != ''
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@develop
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@main
secrets: inherit
with:
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'develop' || inputs.ods_branch }}
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'main' || inputs.ods_branch }}

unittest:
needs: ods_tools
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Platform Vulnerability Scanning](https://github.com/OasisLMF/OasisPlatform/actions/workflows/scan.yml/badge.svg?branch=master)](https://github.com/OasisLMF/OasisPlatform/actions/workflows/scan.yml)


# Oasis Platform
# Oasis Platform 2
Provides core components of the Oasis platform, specifically:
* DJango application that provides the Oasis REST API
* Celery worker for running a model
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/worker-controller/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ multidict==6.0.2
# yarl
python-dateutil==2.8.2
# via kubernetes-asyncio
pyyaml==6.0
pyyaml==5.3.1
# via kubernetes-asyncio
six==1.16.0
# via
Expand Down
2 changes: 2 additions & 0 deletions requirements-worker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ click==8.1.3
# click-didyoumean
# click-plugins
# click-repl
# cligj
# fiona
click-didyoumean==0.3.0
# via celery
Expand Down Expand Up @@ -213,6 +214,7 @@ six==1.16.0
# azure-core
# click-repl
# isodate
# munch
# pathlib2
# python-dateutil
sqlalchemy==1.4.47
Expand Down

0 comments on commit 129fb21

Please sign in to comment.