Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Palmira
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iiit-h
Palmira
Commits
fe40cbd3
Commit
fe40cbd3
authored
2 years ago
by
Nishanth artham
Browse files
Options
Downloads
Patches
Plain Diff
bootstrap with worker template
parent
e38d8871
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Bootstrap the repo with the base-worker tempalte
Pipeline
#130010
failed
2 years ago
Stage: test
Stage: build
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.cookiecutter.json
+1
-0
1 addition, 0 deletions
.cookiecutter.json
Dockerfile
+2
-2
2 additions, 2 deletions
Dockerfile
setup.py
+5
-5
5 additions, 5 deletions
setup.py
tests/conftest.py
+1
-1
1 addition, 1 deletion
tests/conftest.py
tests/test_worker.py
+1
-1
1 addition, 1 deletion
tests/test_worker.py
with
10 additions
and
9 deletions
.cookiecutter.json
+
1
−
0
View file @
fe40cbd3
...
...
@@ -6,3 +6,4 @@
"author"
:
"Nishanth artham"
,
"email"
:
"arthamnishanth123@gmail.com"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Dockerfile
+
2
−
2
View file @
fe40cbd3
...
...
@@ -3,7 +3,7 @@ FROM python:3
WORKDIR
/src
# Install worker as a package
COPY
worker_
{{cookiecutter.slug}} worker_{{cookiecutter.slug}}
COPY
worker_
palmira worker_palmira
COPY
requirements.txt setup.py VERSION ./
RUN
pip
install
.
...
...
@@ -11,4 +11,4 @@ RUN pip install .
RUN
curl https://assets.teklia.com/teklia_dev_ca.pem
>
/usr/local/share/ca-certificates/arkindex-dev.crt
&&
update-ca-certificates
ENV
REQUESTS_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
CMD
["worker-
{{ cookiecutter.slug }}
"]
CMD
["worker-
palmira
"]
This diff is collapsed.
Click to expand it.
setup.py
+
5
−
5
View file @
fe40cbd3
...
...
@@ -5,8 +5,8 @@ from pathlib import Path
from
setuptools
import
find_packages
,
setup
MODULE
=
"
worker_
{{cookiecutter.slug}}
"
COMMAND
=
"
worker-
{{cookiecutter.slug}}
"
MODULE
=
"
worker_
palmira
"
COMMAND
=
"
worker-
palmira
"
def
parse_requirements_line
(
line
):
...
...
@@ -33,9 +33,9 @@ def parse_requirements():
setup
(
name
=
MODULE
,
version
=
open
(
"
VERSION
"
).
read
(),
description
=
"
{{ cookiecutter.description }}
"
,
author
=
"
{{ cookiecutter.author }}
"
,
author_email
=
"
{{ cookiecutter.email }}
"
,
description
=
"
Palm Leaf Manuscript Region Annotator
"
,
author
=
"
Nishanth artham
"
,
author_email
=
"
arthamnishanth123@gmail.com
"
,
install_requires
=
parse_requirements
(),
entry_points
=
{
"
console_scripts
"
:
[
f
"
{
COMMAND
}
=
{
MODULE
}
.worker:main
"
]},
packages
=
find_packages
(),
...
...
This diff is collapsed.
Click to expand it.
tests/conftest.py
+
1
−
1
View file @
fe40cbd3
...
...
@@ -22,7 +22,7 @@ def setup_environment(responses, monkeypatch):
# Set schema url in environment
os
.
environ
[
"
ARKINDEX_API_SCHEMA_URL
"
]
=
schema_url
# Setup a fake worker run ID
os
.
environ
[
"
ARKINDEX_WORKER_RUN_ID
"
]
=
"
1234-
{{ cookiecutter.slug }}
"
os
.
environ
[
"
ARKINDEX_WORKER_RUN_ID
"
]
=
"
1234-
palmira
"
# Setup a mock api client instead of using a real one
monkeypatch
.
setattr
(
BaseWorker
,
"
setup_api_client
"
,
lambda
_
:
MockApiClient
())
This diff is collapsed.
Click to expand it.
tests/test_worker.py
+
1
−
1
View file @
fe40cbd3
...
...
@@ -8,6 +8,6 @@ def test_dummy():
def
test_import
():
"""
Import our newly created module, through importlib to avoid parsing issues
"""
worker
=
importlib
.
import_module
(
"
worker_
{{ cookiecutter.slug }}
.worker
"
)
worker
=
importlib
.
import_module
(
"
worker_
palmira
.worker
"
)
assert
hasattr
(
worker
,
"
Demo
"
)
assert
hasattr
(
worker
.
Demo
,
"
process_element
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment