From 847962c98cab7365edf8684eb82f8408aca91473 Mon Sep 17 00:00:00 2001 From: Odile Kemghou <128539129+okemghou@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:24:53 -0500 Subject: [PATCH 1/9] Create docker-build-push-ghcr.yml --- .github/workflows/docker-build-push-ghcr.yml | 85 ++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/docker-build-push-ghcr.yml diff --git a/.github/workflows/docker-build-push-ghcr.yml b/.github/workflows/docker-build-push-ghcr.yml new file mode 100644 index 0000000..64b825d --- /dev/null +++ b/.github/workflows/docker-build-push-ghcr.yml @@ -0,0 +1,85 @@ +name: Docker-ghcr + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + push: + branches: [ "main", DEV-93 ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }}-${{ github.head_ref || github.ref_name }} + + +jobs: + build-push: + + runs-on: ubuntu-latest + environment: ${{ github.head_ref || github.ref_name }} + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + lfs: true + - run: git lfs pull + + # Workaround: https://github.com/docker/build-push-action/issues/461 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.REGISTRY }} + username: USEPA + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: latest + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + + # Removing old packages and only keeping 3 untagged versions + - name: Delete Package Versions + uses: actions/delete-package-versions@v4.1.0 + with: + package-name: litconnector-${{ github.head_ref || github.ref_name }} + package-type: 'container' + min-versions-to-keep: 3 + delete-only-untagged-versions: 'true' From 9ba02e6203751fa7716f459fba06be0e2870c4ef Mon Sep 17 00:00:00 2001 From: Odile Kemghou <128539129+okemghou@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:28:48 -0500 Subject: [PATCH 2/9] Update docker-build-push-ghcr.yml --- .github/workflows/docker-build-push-ghcr.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-build-push-ghcr.yml b/.github/workflows/docker-build-push-ghcr.yml index 64b825d..bed4be4 100644 --- a/.github/workflows/docker-build-push-ghcr.yml +++ b/.github/workflows/docker-build-push-ghcr.yml @@ -33,9 +33,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - lfs: true - - run: git lfs pull # Workaround: https://github.com/docker/build-push-action/issues/461 - name: Setup Docker buildx @@ -45,7 +42,7 @@ jobs: # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: USEPA @@ -55,7 +52,7 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: latest @@ -77,7 +74,7 @@ jobs: # Removing old packages and only keeping 3 untagged versions - name: Delete Package Versions - uses: actions/delete-package-versions@v4.1.0 + uses: actions/delete-package-versions@v5 with: package-name: litconnector-${{ github.head_ref || github.ref_name }} package-type: 'container' From ee40150e83391737d5839dc09b932103ae7bdba8 Mon Sep 17 00:00:00 2001 From: Odile Kemghou <128539129+okemghou@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:29:44 -0500 Subject: [PATCH 3/9] Update docker-build-push-ghcr.yml --- .github/workflows/docker-build-push-ghcr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push-ghcr.yml b/.github/workflows/docker-build-push-ghcr.yml index bed4be4..ef5e4be 100644 --- a/.github/workflows/docker-build-push-ghcr.yml +++ b/.github/workflows/docker-build-push-ghcr.yml @@ -7,7 +7,7 @@ name: Docker-ghcr on: push: - branches: [ "main", DEV-93 ] + branches: [ "main", DEV-932 ] # Publish semver tags as releases. tags: [ 'v*.*.*' ] From 4e0e9b13c8f4f9a9f0f4f712510ca9f326d8baca Mon Sep 17 00:00:00 2001 From: Odile Kemghou <128539129+okemghou@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:53:05 -0500 Subject: [PATCH 4/9] Update pyproject.toml --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index d4c99e3..d91f716 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,8 @@ dependencies = [ "streamlit>=1.38.0", ] +[tool.poetry.dependencies] +python = ">=3.9" [tool.setuptools.packages.find] where = ["src"] From 7e9ccec95f4e83dd54f2ad341e6fc777189b3aaf Mon Sep 17 00:00:00 2001 From: Odile Kemghou <128539129+okemghou@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:42:10 -0500 Subject: [PATCH 5/9] Update pyproject.toml --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d91f716..55626f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,9 +15,6 @@ dependencies = [ "streamlit>=1.38.0", ] -[tool.poetry.dependencies] -python = ">=3.9" - [tool.setuptools.packages.find] where = ["src"] From 44b5b66b1d93178adcf1430cf231a1a8fe65e1fc Mon Sep 17 00:00:00 2001 From: Kemghou Date: Wed, 13 Nov 2024 16:02:02 -0500 Subject: [PATCH 6/9] TOML to requirements --- requirements.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0060c40 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +mlxtend>=0.23.1 +numpy==1.24.0 +pandas==1.5.2 +rispy>=0.9.0 +streamlit-agraph>=0.0.45 +streamlit>=1.38.0 \ No newline at end of file From e8f81bfe58fbac00608e1261b49bacb8389d207f Mon Sep 17 00:00:00 2001 From: Odile Kemghou <128539129+okemghou@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:20:19 -0500 Subject: [PATCH 7/9] Update docker-build-push-ghcr.yml --- .github/workflows/docker-build-push-ghcr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push-ghcr.yml b/.github/workflows/docker-build-push-ghcr.yml index ef5e4be..70747ce 100644 --- a/.github/workflows/docker-build-push-ghcr.yml +++ b/.github/workflows/docker-build-push-ghcr.yml @@ -7,7 +7,7 @@ name: Docker-ghcr on: push: - branches: [ "main", DEV-932 ] + branches: [ "main" ] # Publish semver tags as releases. tags: [ 'v*.*.*' ] From 4dd7fd9539f1eac9d46bca2e783ee3b4e9cb872a Mon Sep 17 00:00:00 2001 From: Odile Kemghou <128539129+okemghou@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:25:41 -0500 Subject: [PATCH 8/9] Update network_analysis.py --- src/network_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network_analysis.py b/src/network_analysis.py index 5da9afb..4150a0e 100644 --- a/src/network_analysis.py +++ b/src/network_analysis.py @@ -92,7 +92,7 @@ def return_assoc_rules(df, min_support, sort_by, max_len): frequent_itemsets = apriori( df, min_support=min_support, use_colnames=True, max_len=max_len ) - assoc_rules = association_rules(frequent_itemsets, min_threshold=0) + assoc_rules = association_rules(frequent_itemsets, num_itemsets=2, min_threshold=0) pmi = assoc_rules["support"] / ( assoc_rules["antecedent support"] * assoc_rules["consequent support"] From 6771b903c589760d5fd79ddfc7f13b81136b20be Mon Sep 17 00:00:00 2001 From: Odile Kemghou <128539129+okemghou@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:26:18 -0500 Subject: [PATCH 9/9] Update docker-build-push-ghcr.yml --- .github/workflows/docker-build-push-ghcr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push-ghcr.yml b/.github/workflows/docker-build-push-ghcr.yml index 70747ce..ef5e4be 100644 --- a/.github/workflows/docker-build-push-ghcr.yml +++ b/.github/workflows/docker-build-push-ghcr.yml @@ -7,7 +7,7 @@ name: Docker-ghcr on: push: - branches: [ "main" ] + branches: [ "main", DEV-932 ] # Publish semver tags as releases. tags: [ 'v*.*.*' ]