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

Add keyword_extraction (NER) skill #57

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions .github/workflows/build_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
name: "PyPI"
runs-on: ubuntu-latest
steps:
- uses: hmarr/debug-action@v2.1.0
- uses: hmarr/debug-action@v3.0.0

- name: Checkout
uses: actions/checkout@v4
Expand All @@ -62,25 +62,25 @@ jobs:
version=$(sed "s/^v//g" <<< ${PROVIDED_VERSION})
sed -i "s/^version[ ]*=.*/version = \"${version}\"/g" ${{ env.PYTHON_VERSION_FILE }}

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
- name: Set up poetry
uses: snok/install-poetry@v1
with:
python-version: '3.11'
cache: true

- name: Install dependencies
run: |
pdm install --prod
poetry install --without dev

- name: Package
run: pdm build
run: poetry build

- name: Upload to PYPI
if: inputs.upload_to_pypi
env:
PDM_PUBLISH_USERNAME: __token__
PDM_PUBLISH_PASSWORD: ${{ secrets.PYPI_APIKEY }}
run: pdm publish --no-build
POETRY_PYPI_TOKEN_ADALA: ${{ secrets.PYPI_APIKEY }}
run: |
poetry publish

- name: Attach artifacts to release
if: inputs.release-id
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/cicd-pipeline-cancel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "CI/CD pipeline: Cancel PR pipeline"

on:
pull_request_target:
types:
- closed
- converted_to_draft
- locked
branches:
- master

concurrency:
group: CI/CD Pipeline-${{ github.event.pull_request.number || github.event.pull_request.head.ref || github.ref_name }}
cancel-in-progress: true

jobs:
cancel:
runs-on: ubuntu-latest
steps:
- uses: hmarr/[email protected]
- run: echo CI/CD Pipeline-${{ github.event.pull_request.number || github.event.pull_request.head.ref || github.ref_name }}
31 changes: 31 additions & 0 deletions .github/workflows/cicd-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "CI/CD Pipeline"

on:
push:
branches:
- master
pull_request_target:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- master

concurrency:
group: CI/CD Pipeline-${{ github.event.pull_request.number || github.event.pull_request.head.ref || github.ref_name }}
cancel-in-progress: true

jobs:

build:
name: "Build"
uses: ./.github/workflows/docker-build.yml
permissions:
contents: read
checks: write
with:
sha: ${{ github.event.pull_request.head.sha || github.event.after }}
branch_name: ${{ github.event.pull_request.head.ref || github.ref_name }}
secrets: inherit
37 changes: 37 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "CodeQL"

on:
push:
branches: [ "master", "release/**" ]
schedule:
- cron: '00 22 * * 0'

jobs:
analyze:
name: Analyze
runs-on: 'ubuntu-latest'
timeout-minutes: 45
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript', 'python' ]

steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# config-file: ./.github/codeql/codeql-config.yaml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
122 changes: 122 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: "Docker build & push"

on:
workflow_call:
inputs:
sha:
required: true
type: string
branch_name:
required: true
type: string
outputs:
image_version:
description: "Docker tag"
value: ${{ jobs.docker_build_and_push.outputs.image_version }}

env:
DOCKER_CLI_EXPERIMENTAL: enabled
IMAGE_NAME: "${{ vars.DOCKERHUB_ORG }}/adala"
DOCKER_IMAGE_TAG_CHECK_NAME: "Docker image tag"

jobs:
docker_build_and_push:
name: "Docker image"
timeout-minutes: 15
runs-on: ubuntu-latest
outputs:
image_version: ${{ steps.version.outputs.image_version }}
steps:
- uses: hmarr/[email protected]

- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ github.token }}
ref: ${{ inputs.sha }}
fetch-depth: 0

- name: Calculate version
id: version
env:
BRANCH_NAME: ${{ inputs.branch_name }}
run: |
set -x
pretty_branch_name="$(echo -n "${BRANCH_NAME#refs/heads/}" | sed 's#/#-#g' | sed 's#_#-#g'| sed 's#\.#-#g' | tr '[:upper:]' '[:lower:]')"
echo "pretty_branch_name=$pretty_branch_name" >> $GITHUB_OUTPUT
current_time="$(date +'%Y%m%d.%H%M%S')"
branch="-${pretty_branch_name}"
short_sha="$(git rev-parse --short HEAD)"
long_sha="$(git rev-parse HEAD)"
echo "sha=$long_sha" >> $GITHUB_OUTPUT
short_sha_length="$(echo $short_sha | awk '{print length}')"
current_time_length="$(echo $current_time | awk '{print length}')"
version="${current_time}$(echo $branch | cut -c1-$((50 - short_sha_length - current_time_length)))-${short_sha}"
echo "image_version=$version" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Calculate Docker tags
id: calculate-docker-tags
uses: actions/github-script@v7
env:
TAGS: "${{ steps.version.outputs.image_version }},${{ steps.version.outputs.pretty_branch_name }}"
IMAGE_NAME: ${{ env.IMAGE_NAME }}
with:
script: |
const raw_tags_input = process.env.TAGS;
const image_name = process.env.IMAGE_NAME;

const tags = raw_tags_input.split(',').map(x => x.trim());
const docker_tags = tags.map(x => `${image_name}:${x}`).join(',');
console.log(docker_tags);
core.setOutput("docker-tags", docker_tags);

- name: Push Docker image
uses: docker/[email protected]
id: docker_build_and_push
with:
context: .
file: Dockerfile.app
push: true
tags: ${{ steps.calculate-docker-tags.outputs.docker-tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Create Docker image tag Check
uses: actions/github-script@v7
with:
script: |
const { repo, owner } = context.repo;
const details = {
"branch": "${{ inputs.branch_name }}",
"pretty_branch_name": "${{ steps.version.outputs.pretty_branch_name }}",
"image_version": "${{ steps.version.outputs.image_version }}",
"sha": "${{ steps.version.outputs.sha }}"
}
const { data: check } = await github.rest.checks.create({
owner,
repo,
name: '${{ env.DOCKER_IMAGE_TAG_CHECK_NAME }}',
head_sha: '${{ steps.version.outputs.sha }}',
status: 'in_progress',
output: {
title: '${{ env.DOCKER_IMAGE_TAG_CHECK_NAME }}',
summary: JSON.stringify(details)
}
});
await github.rest.checks.update({
owner,
repo,
check_run_id: check.id,
status: 'completed',
conclusion: 'success'
});
16 changes: 8 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
- name: Set up poetry
uses: snok/install-poetry@v1
with:
python-version: "3.11"
cache: true

- name: Install Python dependencies
run: |
pdm sync -G doc
poetry install --sync

- name: Build MkDocs site
run: |
cd docs/
pdm run mkdocs build
poetry run mkdocs build

upload:
name: "Upload"
Expand All @@ -45,17 +45,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
- name: Set up poetry
uses: snok/install-poetry@v1
with:
python-version: "3.11"
cache: true

- name: Install Python dependencies
run: |
pdm sync -G doc
poetry install --sync

- name: Deploy docs
run: |
cd docs/
pdm run mkdocs gh-deploy --force
poetry run mkdocs gh-deploy --force
2 changes: 1 addition & 1 deletion .github/workflows/jira-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: hmarr/debug-action@v2.1.0
- uses: hmarr/debug-action@v3.0.0

- name: Add Workflow link to command comment
uses: peter-evans/create-or-update-comment@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-cut-off-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: hmarr/debug-action@v2.1.0
- uses: hmarr/debug-action@v3.0.0

- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-set-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
permissions:
contents: write
steps:
- uses: hmarr/debug-action@v2.1.0
- uses: hmarr/debug-action@v3.0.0

- name: Checkout
uses: actions/checkout@v4
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
- name: Set up poetry
uses: snok/install-poetry@v1
with:
python-version: '3.11'
cache: true

- name: Install dependencies
run: |
pdm install --prod
poetry install --without dev

- name: Release to PyPI
env:
PDM_PUBLISH_USERNAME: __token__
PDM_PUBLISH_PASSWORD: ${{ secrets.PYPI_APIKEY }}
POETRY_PYPI_TOKEN_ADALA: ${{ secrets.PYPI_APIKEY }}
run: |
pdm publish
poetry publish
6 changes: 3 additions & 3 deletions .github/workflows/slash-command-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- uses: hmarr/debug-action@v2.1.0
- uses: hmarr/debug-action@v3.0.0

- name: 'Validate command'
id: determine_command
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Slash Command Dispatch for Issues
id: scd_issues
if: ${{ steps.determine_command.outputs.command_state != 'unknown' && steps.determine_command.outputs.is_issue_command == 'true' }}
uses: peter-evans/slash-command-dispatch@v3
uses: peter-evans/slash-command-dispatch@v4
with:
token: ${{ secrets.GIT_PAT }}
reaction-token: ${{ secrets.GIT_PAT }}
Expand All @@ -60,7 +60,7 @@ jobs:
- name: Slash Command Dispatch for PRs
id: scd_prs
if: ${{ steps.determine_command.outputs.command_state != 'unknown' && steps.determine_command.outputs.is_issue_command != 'true' }}
uses: peter-evans/slash-command-dispatch@v3
uses: peter-evans/slash-command-dispatch@v4
with:
token: ${{ secrets.GIT_PAT }}
reaction-token: ${{ secrets.GIT_PAT }}
Expand Down
Loading
Loading