From 5f2eec88484a8215a7dbc4ee075d3f0b6c2d84d5 Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 19:45:58 +0000 Subject: [PATCH 1/9] mambaforge is depricated and need miniforge for action builds --- .github/workflows/cgatcore_python.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cgatcore_python.yml b/.github/workflows/cgatcore_python.yml index 87138ff5..f2782523 100644 --- a/.github/workflows/cgatcore_python.yml +++ b/.github/workflows/cgatcore_python.yml @@ -30,13 +30,13 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/environments/cgat-core.yml') }} - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: ${{ matrix.python-version }} - channels: conda-forge, bioconda, defaults - channel-priority: true - activate-environment: cgat-core - environment-file: conda/environments/cgat-core.yml - miniforge-variant: Mambaforge + with: + python-version: ${{ matrix.python-version }} + channels: conda-forge, bioconda, defaults + channel-priority: true + activate-environment: cgat-core + environment-file: conda/environments/cgat-core.yml + miniforge-variant: Miniforge - name: Show conda run: | conda info From b5a97d9da09ded6b9f3b7d0f45ff642f17fabedb Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 19:48:46 +0000 Subject: [PATCH 2/9] Revert "mambaforge is depricated and need miniforge for action builds" This reverts commit 5f2eec88484a8215a7dbc4ee075d3f0b6c2d84d5. --- .github/workflows/cgatcore_python.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cgatcore_python.yml b/.github/workflows/cgatcore_python.yml index f2782523..87138ff5 100644 --- a/.github/workflows/cgatcore_python.yml +++ b/.github/workflows/cgatcore_python.yml @@ -30,13 +30,13 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/environments/cgat-core.yml') }} - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: ${{ matrix.python-version }} - channels: conda-forge, bioconda, defaults - channel-priority: true - activate-environment: cgat-core - environment-file: conda/environments/cgat-core.yml - miniforge-variant: Miniforge + with: + python-version: ${{ matrix.python-version }} + channels: conda-forge, bioconda, defaults + channel-priority: true + activate-environment: cgat-core + environment-file: conda/environments/cgat-core.yml + miniforge-variant: Mambaforge - name: Show conda run: | conda info From 06cdd31516401793c3250f4d585a6d85d23febdf Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 19:50:37 +0000 Subject: [PATCH 3/9] github actions didnt pick up my previous file, attempted to only change the one line in case of issues with tabs --- .github/workflows/cgatcore_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cgatcore_python.yml b/.github/workflows/cgatcore_python.yml index 87138ff5..4a241cdc 100644 --- a/.github/workflows/cgatcore_python.yml +++ b/.github/workflows/cgatcore_python.yml @@ -36,7 +36,7 @@ jobs: channel-priority: true activate-environment: cgat-core environment-file: conda/environments/cgat-core.yml - miniforge-variant: Mambaforge + miniforge-variant: Miniforge - name: Show conda run: | conda info From 2470db5ad7fbaa8df2c18d92b97603b188672d24 Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 19:52:59 +0000 Subject: [PATCH 4/9] try v1 of miniconda setup --- .github/workflows/cgatcore_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cgatcore_python.yml b/.github/workflows/cgatcore_python.yml index 4a241cdc..ec68853e 100644 --- a/.github/workflows/cgatcore_python.yml +++ b/.github/workflows/cgatcore_python.yml @@ -29,7 +29,7 @@ jobs: key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/environments/cgat-core.yml') }} - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v1 with: python-version: ${{ matrix.python-version }} channels: conda-forge, bioconda, defaults From 310c0b382bb74e53bf482e1dfddc5dba3e1b4b29 Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 19:56:05 +0000 Subject: [PATCH 5/9] specify the url link --- .github/workflows/cgatcore_python.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cgatcore_python.yml b/.github/workflows/cgatcore_python.yml index ec68853e..faebf19f 100644 --- a/.github/workflows/cgatcore_python.yml +++ b/.github/workflows/cgatcore_python.yml @@ -26,11 +26,10 @@ jobs: CACHE_NUMBER: 0 with: path: ~/conda_pkgs_dir - key: - ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ - hashFiles('conda/environments/cgat-core.yml') }} + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/environments/cgat-core.yml') }} - uses: conda-incubator/setup-miniconda@v1 with: + installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh python-version: ${{ matrix.python-version }} channels: conda-forge, bioconda, defaults channel-priority: true From 2767d85c08cf07b50e5faad45a24b9301e0f1c41 Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 19:58:21 +0000 Subject: [PATCH 6/9] made changes to file paths --- .github/workflows/cgatcore_python.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cgatcore_python.yml b/.github/workflows/cgatcore_python.yml index faebf19f..9e216dbf 100644 --- a/.github/workflows/cgatcore_python.yml +++ b/.github/workflows/cgatcore_python.yml @@ -36,6 +36,8 @@ jobs: activate-environment: cgat-core environment-file: conda/environments/cgat-core.yml miniforge-variant: Miniforge + - name: Configure Conda Paths + run: echo "${{ secrets.PATH }}:/usr/share/miniconda3/condabin" >> $GITHUB_PATH - name: Show conda run: | conda info From b3cef0e16986df72820902eb383e4334bb145743 Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 20:00:26 +0000 Subject: [PATCH 7/9] cleaned up yml and remove issues --- .github/workflows/cgatcore_python.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cgatcore_python.yml b/.github/workflows/cgatcore_python.yml index 9e216dbf..dc9ac3f5 100644 --- a/.github/workflows/cgatcore_python.yml +++ b/.github/workflows/cgatcore_python.yml @@ -27,7 +27,7 @@ jobs: with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/environments/cgat-core.yml') }} - - uses: conda-incubator/setup-miniconda@v1 + - uses: conda-incubator/setup-miniconda@v2 with: installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh python-version: ${{ matrix.python-version }} @@ -35,9 +35,8 @@ jobs: channel-priority: true activate-environment: cgat-core environment-file: conda/environments/cgat-core.yml - miniforge-variant: Miniforge - name: Configure Conda Paths - run: echo "${{ secrets.PATH }}:/usr/share/miniconda3/condabin" >> $GITHUB_PATH + run: echo "/usr/share/miniconda3/condabin" >> $GITHUB_PATH - name: Show conda run: | conda info From 64da95545963c26c5aac68796e2cb47419ade752 Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 20:03:25 +0000 Subject: [PATCH 8/9] oops forgot to make it work with osx --- .github/workflows/cgatcore_python.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cgatcore_python.yml b/.github/workflows/cgatcore_python.yml index dc9ac3f5..80a0b09f 100644 --- a/.github/workflows/cgatcore_python.yml +++ b/.github/workflows/cgatcore_python.yml @@ -27,9 +27,17 @@ jobs: with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/environments/cgat-core.yml') }} + - name: Set installer URL + id: set-installer-url + run: | + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + echo "installer-url=https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" >> $GITHUB_ENV + elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then + echo "installer-url=https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh" >> $GITHUB_ENV + fi - uses: conda-incubator/setup-miniconda@v2 with: - installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh + installer-url: ${{ env.installer-url }} python-version: ${{ matrix.python-version }} channels: conda-forge, bioconda, defaults channel-priority: true From 9542a1b251e6385e45722783890bd9b2129daa27 Mon Sep 17 00:00:00 2001 From: Acribbs Date: Sun, 10 Nov 2024 20:16:10 +0000 Subject: [PATCH 9/9] default cpu when value is not integer --- cgatcore/pipeline/execution.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cgatcore/pipeline/execution.py b/cgatcore/pipeline/execution.py index 1741bb1c..df529871 100644 --- a/cgatcore/pipeline/execution.py +++ b/cgatcore/pipeline/execution.py @@ -1038,10 +1038,16 @@ def _convert(key, v): data.update(dict([(x[0], _convert(x[0], x[1])) for x in pairs if len(x) == 2])) - # remove % sign + cpu_value = data.get("percent_cpu", "0") + # Strip potential '%' symbols, handle non-numeric cases gracefully + try: + percent_cpu = int(re.sub("%", "", cpu_value)) if cpu_value.replace("%", "").strip().isdigit() else 0 + except ValueError: + percent_cpu = 0 # Default or fallback value, adjust as necessary + data.update( - {"percent_cpu": int(re.sub("%", "", data.get("percent_cpu", 0))), - "cpu_t": float(data["user_t"]) + float(data["sys_t"])}) + {"percent_cpu": percent_cpu, + "cpu_t": float(data.get("user_t", 0)) + float(data.get("sys_t", 0))}) return JobInfo(jobId=process.pid, resourceUsage=data)