Skip to content

Commit

Permalink
use pipfile and copy metadata on component folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishab Prasad committed Sep 17, 2024
1 parent 7f6f742 commit b610c1a
Show file tree
Hide file tree
Showing 4 changed files with 252 additions and 20 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/Gated-Auto-Merger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,50 @@ jobs:
- uses: actions/checkout@v3
with:
path: main
- name: Install dependencies

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: '3.10.15' # Specify the Python version you need

- name: Install pipenv
run: |
cd main
pip install -r requirements.txt
python -m pip install --upgrade pip
pip install pipenv
- name: Install dependencies from Pipfile.lock
run: cd main && pipenv install --ignore-pipfile

- name: Trigger GAM
env:
HYDRA_TOKEN: ${{ secrets.HYDRA_TOKEN }}
shell: bash
id: trigger_gam
run: |
cd main
python src/main.py --component ${{ github.event.inputs.component }}
echo "inside main"
pwd
ls
cd ../
pipenv run python src/main.py --component ${{ github.event.inputs.component }}
- uses: actions/checkout@v3
with:
ref: metadata
path: metadata

- name: Copy metadata Json
id: copy_meta
run: |
meta=$(yq -o json main/$METADATA)
execution_id=$(echo $meta | jq -r '.metadata.execution_id')
echo "execution_id=$execution_id"
mkdir metadata/executions/${execution_id}
cp main/data/metadata.yaml metadata/executions/${execution_id}
echo "inside metadata"
cd metadata/executions/${execution_id}/
pwd
ls
cat metadata.yaml
echo "EXECUTION_ID=${EXECUTION_ID}" >> $GITHUB_OUTPUT
component_name=$(echo $meta | jq -r '.metadata.name')
metadata_folder="metadata/executions/${component_name}/${execution_id}"
mkdir -p ${metadata_folder}
cp main/$METADATA ${metadata_folder}
echo "Metadata File: ${metadata_folder}"
echo "Copied Metadata:"
cat ${metadata_folder}/metadata.yaml
echo "EXECUTION_ID=${execution_id}" >> $GITHUB_OUTPUT
- name: Commit and push changes to main branch
uses: actions-js/push@master
with:
Expand Down
14 changes: 14 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.32.3"
pyyaml = "~=6.0.2"

[dev-packages]

[requires]
python_version = "3.10"
python_full_version = "3.10.15"
211 changes: 211 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

0 comments on commit b610c1a

Please sign in to comment.