Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Base Worker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Workers
Base Worker
Commits
ea23e90e
Verified
Commit
ea23e90e
authored
2 years ago
by
Yoann Schneider
Browse files
Options
Downloads
Patches
Plain Diff
use ARKINDEX_WORKER_RUN_ID
parent
e0f7e1aa
No related branches found
No related tags found
No related merge requests found
Pipeline
#79313
passed
2 years ago
Stage: test
Stage: build
Stage: release
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arkindex_worker/worker/base.py
+2
-2
2 additions, 2 deletions
arkindex_worker/worker/base.py
tests/conftest.py
+1
-1
1 addition, 1 deletion
tests/conftest.py
tests/test_base_worker.py
+3
-3
3 additions, 3 deletions
tests/test_base_worker.py
with
6 additions
and
6 deletions
arkindex_worker/worker/base.py
+
2
−
2
View file @
ea23e90e
...
...
@@ -110,10 +110,10 @@ class BaseWorker(object):
logger
.
warning
(
"
Missing WORKER_VERSION_ID environment variable, worker is in read-only mode
"
)
self
.
worker_run_id
=
os
.
environ
.
get
(
"
WORKER_RUN_ID
"
)
self
.
worker_run_id
=
os
.
environ
.
get
(
"
ARKINDEX_
WORKER_RUN_ID
"
)
if
not
self
.
worker_run_id
:
logger
.
warning
(
"
Missing WORKER_RUN_ID environment variable, worker is in read-only mode
"
"
Missing
ARKINDEX_
WORKER_RUN_ID environment variable, worker is in read-only mode
"
)
logger
.
info
(
f
"
Worker will use
{
self
.
work_dir
}
as working directory
"
)
...
...
This diff is collapsed.
Click to expand it.
tests/conftest.py
+
1
−
1
View file @
ea23e90e
...
...
@@ -104,7 +104,7 @@ def setup_api(responses, monkeypatch, cache_yaml):
def
give_env_variable
(
request
,
monkeypatch
):
"""
Defines required environment variables
"""
monkeypatch
.
setenv
(
"
WORKER_VERSION_ID
"
,
"
12341234-1234-1234-1234-123412341234
"
)
monkeypatch
.
setenv
(
"
WORKER_RUN_ID
"
,
"
56785678-5678-5678-5678-567856785678
"
)
monkeypatch
.
setenv
(
"
ARKINDEX_
WORKER_RUN_ID
"
,
"
56785678-5678-5678-5678-567856785678
"
)
monkeypatch
.
setenv
(
"
ARKINDEX_CORPUS_ID
"
,
"
11111111-1111-1111-1111-111111111111
"
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_base_worker.py
+
3
−
3
View file @
ea23e90e
...
...
@@ -49,7 +49,7 @@ def test_init_var_ponos_data_given(monkeypatch):
def
test_init_var_worker_version_id_missing
(
monkeypatch
):
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
worker
"
])
monkeypatch
.
delenv
(
"
WORKER_VERSION_ID
"
)
monkeypatch
.
delenv
(
"
WORKER_RUN_ID
"
)
monkeypatch
.
delenv
(
"
ARKINDEX_
WORKER_RUN_ID
"
)
worker
=
BaseWorker
()
worker
.
args
=
worker
.
parser
.
parse_args
()
worker
.
configure_for_developers
()
...
...
@@ -60,7 +60,7 @@ def test_init_var_worker_version_id_missing(monkeypatch):
def
test_init_var_worker_run_id_missing
(
monkeypatch
):
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
worker
"
])
monkeypatch
.
delenv
(
"
WORKER_RUN_ID
"
)
monkeypatch
.
delenv
(
"
ARKINDEX_
WORKER_RUN_ID
"
)
worker
=
BaseWorker
()
worker
.
args
=
worker
.
parser
.
parse_args
()
worker
.
configure_for_developers
()
...
...
@@ -76,7 +76,7 @@ def test_init_var_worker_local_file(monkeypatch, tmp_path):
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
worker
"
,
"
-c
"
,
str
(
config
)])
monkeypatch
.
delenv
(
"
WORKER_VERSION_ID
"
)
monkeypatch
.
delenv
(
"
WORKER_RUN_ID
"
)
monkeypatch
.
delenv
(
"
ARKINDEX_
WORKER_RUN_ID
"
)
worker
=
BaseWorker
()
worker
.
args
=
worker
.
parser
.
parse_args
()
worker
.
configure_for_developers
()
...
...
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