Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV-932] Deploy on TH874 #1

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/docker-build-push-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
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-932 ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
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

# 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@v3
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@v5
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@v5
with:
package-name: litconnector-${{ github.head_ref || github.ref_name }}
package-type: 'container'
min-versions-to-keep: 3
delete-only-untagged-versions: 'true'
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ dependencies = [
"streamlit>=1.38.0",
]


[tool.setuptools.packages.find]
where = ["src"]

6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/network_analysis.py
Original file line number Diff line number Diff line change
@@ -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"]
Loading
Oops, something went wrong.