-
Notifications
You must be signed in to change notification settings - Fork 5
chore(medcat-trainer): CU-869a4br6j Create a copy of the v1 medcat-trainer in the v1 folder #97
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,68 @@ | ||||||||||||||||||||
| name: medcat-trainer-v1 ci-build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| pull_request: | ||||||||||||||||||||
| paths: | ||||||||||||||||||||
| - 'v1/medcat-trainer/**' | ||||||||||||||||||||
| - '.github/workflows/medcat-trainer-v1**' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| defaults: | ||||||||||||||||||||
| run: | ||||||||||||||||||||
| working-directory: ./v1/medcat-trainer | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| # Test and build client library | ||||||||||||||||||||
| test-client: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout main | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| ref: ${{ github.ref }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||
| uses: actions/setup-python@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| python-version: '3.10' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||
| pip install requests pytest build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install client package in development mode | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| cd client | ||||||||||||||||||||
| pip install -e . | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run client tests | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| cd client | ||||||||||||||||||||
| python -m pytest tests/ -v | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build client package | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| cd client | ||||||||||||||||||||
| python -m build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Build and test webapp container | ||||||||||||||||||||
| build-and-push: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| needs: test-client | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout main | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| ref: ${{ github.ref }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| IMAGE_TAG: ${{ env.RELEASE_VERSION }} | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| docker build -t cogstacksystems/medcat-trainer:dev-latest webapp/. | ||||||||||||||||||||
| - name: Run Django Tests | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| IMAGE_TAG: ${{ env.RELEASE_VERSION }} | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| # run tests | ||||||||||||||||||||
| docker run --rm cogstacksystems/medcat-trainer:dev-latest python manage.py test | ||||||||||||||||||||
|
Comment on lines
+50
to
+68
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 months ago To fix the problem, add a
Suggested changeset
1
.github/workflows/medcat-trainer-v1_ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,82 @@ | ||||||||||||||||||||
| name: medcat-trainer-v1 qa-build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| push: | ||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||
|
|
||||||||||||||||||||
| defaults: | ||||||||||||||||||||
| run: | ||||||||||||||||||||
| working-directory: ./v1/medcat-trainer | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| # Test and build client library | ||||||||||||||||||||
| test-client: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout main | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| ref: 'main' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||
| uses: actions/setup-python@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| python-version: '3.10' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||
| pip install requests pytest build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install client package in development mode | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| cd client | ||||||||||||||||||||
| pip install -e . | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run client tests | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| cd client | ||||||||||||||||||||
| python -m pytest tests/ -v | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build client package | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| cd client | ||||||||||||||||||||
| python -m build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # - name: Publish dev distribution to Test PyPI | ||||||||||||||||||||
| # uses: pypa/gh-action-pypi-publish@v1.4.2 | ||||||||||||||||||||
| # with: | ||||||||||||||||||||
| # password: ${{ secrets.MEDCAT_TRAINER_TEST_PYPI_API_TOKEN }} | ||||||||||||||||||||
| # repository_url: https://test.pypi.org/legacy/ | ||||||||||||||||||||
| # packages_dir: v1/medcat-trainer/client/dist | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Build and test webapp container | ||||||||||||||||||||
| build-and-push: | ||||||||||||||||||||
|
Comment on lines
+14
to
+54
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 months ago To fix the problem, add a
Suggested changeset
1
.github/workflows/medcat-trainer-v1_qa.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| needs: test-client | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout main | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| ref: 'main' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| docker build -t cogstacksystems/medcat-trainer:v1-latest webapp/. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run Django Tests | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| IMAGE_TAG: latest | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| # run tests | ||||||||||||||||||||
| docker run --rm cogstacksystems/medcat-trainer:v1-latest python manage.py test | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Login to DockerHub | ||||||||||||||||||||
| uses: docker/login-action@v3 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||||||||||||||||||
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Push to DockerHub | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| docker push cogstacksystems/medcat-trainer:v1-latest | ||||||||||||||||||||
|
Comment on lines
+55
to
+82
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 months ago To fix the problem, you should add a
Suggested changeset
1
.github/workflows/medcat-trainer-v1_qa.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,95 @@ | |||||||||||||||||||||||||||||
| name: medcat-trainer-v1 release-build | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||
| push: | |||||||||||||||||||||||||||||
| tags: | |||||||||||||||||||||||||||||
| - 'medcat-trainer/v1.*.*' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| defaults: | |||||||||||||||||||||||||||||
| run: | |||||||||||||||||||||||||||||
| working-directory: ./v1/medcat-trainer | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| # Test, build and publish client library | |||||||||||||||||||||||||||||
| test-and-publish-client: | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout main | |||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| ref: "main" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Release Tag | |||||||||||||||||||||||||||||
| # If GITHUB_REF=refs/tags/medcat-trainer/v0.1.2, this returns v0.1.2. Note it's including the "v" though it probably shouldnt | |||||||||||||||||||||||||||||
| run: echo "RELEASE_VERSION=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Set up Python | |||||||||||||||||||||||||||||
| uses: actions/setup-python@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| python-version: '3.10' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install dependencies | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| python -m pip install --upgrade pip | |||||||||||||||||||||||||||||
| pip install requests pytest build twine | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install client package in development mode | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| cd client | |||||||||||||||||||||||||||||
| pip install -e . | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run client tests | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| cd client | |||||||||||||||||||||||||||||
| python -m pytest tests/ -v | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Build client package | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| cd client | |||||||||||||||||||||||||||||
| python -m build | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Publish production distribution to PyPI | |||||||||||||||||||||||||||||
| if: startsWith(github.ref, 'refs/tags') && ! github.event.release.prerelease | |||||||||||||||||||||||||||||
| uses: pypa/gh-action-pypi-publish@v1.4.2 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| # TODO CU-869a25n7e Use Trusted Platform Publisher based PyPI release | |||||||||||||||||||||||||||||
| password: ${{ secrets.PYPI_API_TOKEN }} | |||||||||||||||||||||||||||||
| packages_dir: v1/medcat-trainer/client/dist | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| # Build and test webapp container | |||||||||||||||||||||||||||||
| build-and-push: | |||||||||||||||||||||||||||||
|
Comment on lines
+15
to
+60
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 months ago To fix the problem, add a Steps:
Suggested changeset
1
.github/workflows/medcat-trainer-v1_release.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| needs: test-and-publish-client | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout main | |||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| ref: "main" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Release Tag | |||||||||||||||||||||||||||||
| # If GITHUB_REF=refs/tags/medcat-trainer/v0.1.2, this returns v0.1.2. Note it's including the "v" though it probably shouldnt | |||||||||||||||||||||||||||||
| run: echo "RELEASE_VERSION=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV | |||||||||||||||||||||||||||||
| - name: Build | |||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||
| IMAGE_TAG: ${{ env.RELEASE_VERSION }} | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| docker build -t cogstacksystems/medcat-trainer:$IMAGE_TAG webapp/. | |||||||||||||||||||||||||||||
| - name: Run Django Tests | |||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||
| IMAGE_TAG: ${{ env.RELEASE_VERSION }} | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| # run tests | |||||||||||||||||||||||||||||
| docker run --rm cogstacksystems/medcat-trainer:$IMAGE_TAG python manage.py test | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Login to DockerHub | |||||||||||||||||||||||||||||
| uses: docker/login-action@v3 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |||||||||||||||||||||||||||||
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Push to DockerHub | |||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||
| IMAGE_TAG: ${{ env.RELEASE_VERSION }} | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| docker push cogstacksystems/medcat-trainer:$IMAGE_TAG | |||||||||||||||||||||||||||||
|
Comment on lines
+61
to
+94
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 months ago To fix the problem, add an explicit
Suggested changeset
1
.github/workflows/medcat-trainer-v1_release.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # MedCAT | ||
| SPACY_MODELS="en_core_web_sm en_core_web_md en_core_web_lg" | ||
|
|
||
| # Ports | ||
| MCTRAINER_PORT=8001 | ||
| SOLR_PORT=8983 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #Directories to be ignored fully | ||
| /books/ | ||
| /articles/ | ||
| /other/ | ||
| /output/ | ||
| /graphics/ | ||
| /webapp/models/* | ||
| data/ | ||
| tmp/ | ||
| *_tmp/ | ||
| .idea | ||
|
|
||
| /webapp/frontend/dist/* | ||
| /webapp/api/media/* | ||
| /webapp/api/static/* | ||
|
|
||
| # Configuration | ||
| .env | ||
|
|
||
| # Keep folders with this | ||
| !.keep | ||
|
|
||
| #tmp and similar files | ||
| .nfs* | ||
| *.pyc | ||
| *.out | ||
| *.swp | ||
| *.swn | ||
| tmp_* | ||
| t_* | ||
| tmp_* | ||
| *_tmp | ||
| *.swo | ||
| *.lyx.emergency | ||
| *.lyx# | ||
| *~ | ||
| *.log | ||
| *hidden* | ||
| db.sqlite3 | ||
| nohup.out | ||
| tmp.py | ||
|
|
||
| # docs outputs | ||
| docs/_build | ||
|
|
||
| # macOS system files | ||
| .DS_Store | ||
| */.DS_Store | ||
|
|
||
| # Jupyter Notebook checkpoints | ||
| */.ipynb_checkpoints/* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # .readthedocs.yaml | ||
| # Read the Docs configuration file | ||
| # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
|
||
| version: 2 | ||
|
|
||
| build: | ||
| os: ubuntu-20.04 | ||
| tools: | ||
| python: "3.9" | ||
|
|
||
| sphinx: | ||
| configuration: medcat-trainer/docs/conf.py | ||
|
|
||
| python: | ||
| install: | ||
| - requirements: medcat-trainer/docs/requirements.txt |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 3 months ago
To fix the problem, add a
permissionsblock to the workflow file to explicitly set the minimal required permissions for theGITHUB_TOKEN. Since the workflow only checks out code, installs dependencies, runs tests, and builds packages/containers, it does not require any write permissions. The minimal required permission iscontents: read, which allows the workflow to read repository contents. This block should be added at the top level of the workflow file (after thename:and beforeon:), so it applies to all jobs in the workflow. No changes to the jobs or steps are needed.