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
50596f7f
Verified
Commit
50596f7f
authored
2 years ago
by
Yoann Schneider
Browse files
Options
Downloads
Patches
Plain Diff
remove now unused ARKINDEX_PROCESS_ID
parent
f0cb7b0a
No related branches found
No related tags found
No related merge requests found
Pipeline
#79310
failed
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/git.py
+0
-1
0 additions, 1 deletion
arkindex_worker/git.py
arkindex_worker/worker/base.py
+10
-10
10 additions, 10 deletions
arkindex_worker/worker/base.py
tests/conftest.py
+5
-6
5 additions, 6 deletions
tests/conftest.py
with
15 additions
and
17 deletions
arkindex_worker/git.py
+
0
−
1
View file @
50596f7f
...
...
@@ -207,7 +207,6 @@ class GitHelper:
in worker.configure() configure the git helper and start the cloning:
```
gitlab = GitlabHelper(...)
workflow_id = os.environ[
"
ARKINDEX_PROCESS_ID
"
]
prepare_git_key(...)
self.git_helper = GitHelper(workflow_id=workflow_id, gitlab_helper=gitlab, ...)
self.git_helper.run_clone_in_background()
...
...
This diff is collapsed.
Click to expand it.
arkindex_worker/worker/base.py
+
10
−
10
View file @
50596f7f
...
...
@@ -85,7 +85,6 @@ class BaseWorker(object):
help
=
(
"
Run worker in developer mode.
"
"
Worker will be in read-only state even if a worker_version is supplied.
"
"
ARKINDEX_PROCESS_ID environment variable is not required with this flag.
"
),
action
=
"
store_true
"
,
default
=
False
,
...
...
@@ -185,11 +184,14 @@ class BaseWorker(object):
# Load process information
self
.
process_information
=
worker_run
[
"
process
"
]
#
Retrieve initial configuration from API
#
Load worker version information
worker_version
=
worker_run
[
"
worker_version
"
]
self
.
worker_details
=
worker_version
[
"
worker
"
]
logger
.
info
(
f
"
Loaded worker
{
worker_
version
[
'
worker
'
]
[
'
name
'
]
}
revision
{
worker_version
[
'
revision
'
][
'
hash
'
][
0
:
7
]
}
from API
"
f
"
Loaded worker
{
self
.
worker_
details
[
'
name
'
]
}
revision
{
worker_version
[
'
revision
'
][
'
hash
'
][
0
:
7
]
}
from API
"
)
# Retrieve initial configuration from API
self
.
config
=
worker_version
[
"
configuration
"
][
"
configuration
"
]
if
"
user_configuration
"
in
worker_version
[
"
configuration
"
]:
# Add default values (if set) to user_configuration
...
...
@@ -198,10 +200,9 @@ class BaseWorker(object):
].
items
():
if
"
default
"
in
value
:
self
.
user_configuration
[
key
]
=
value
[
"
default
"
]
self
.
worker_details
=
worker_version
[
"
worker
"
]
required_secrets
=
worker_version
[
"
configuration
"
].
get
(
"
secrets
"
,
[])
# Load all required secrets
required_secrets
=
worker_version
[
"
configuration
"
].
get
(
"
secrets
"
,
[])
self
.
secrets
=
{
name
:
self
.
load_secret
(
name
)
for
name
in
required_secrets
}
# Load worker run configuration when available
...
...
@@ -209,11 +210,10 @@ class BaseWorker(object):
self
.
user_configuration
=
worker_configuration
.
get
(
"
configuration
"
)
if
self
.
user_configuration
:
logger
.
info
(
"
Loaded user configuration from WorkerRun
"
)
# if debug mode is set to true activate debug mode in logger
if
self
.
user_configuration
and
self
.
user_configuration
.
get
(
"
debug
"
):
logger
.
setLevel
(
logging
.
DEBUG
)
logger
.
debug
(
"
Debug output enabled
"
)
# if debug mode is set to true activate debug mode in logger
if
self
.
user_configuration
.
get
(
"
debug
"
):
logger
.
setLevel
(
logging
.
DEBUG
)
logger
.
debug
(
"
Debug output enabled
"
)
def
configure_cache
(
self
):
task_id
=
os
.
environ
.
get
(
"
PONOS_TASK
"
)
...
...
This diff is collapsed.
Click to expand it.
tests/conftest.py
+
5
−
6
View file @
50596f7f
...
...
@@ -105,7 +105,6 @@ 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_PROCESS_ID
"
,
"
aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff
"
)
monkeypatch
.
setenv
(
"
ARKINDEX_CORPUS_ID
"
,
"
11111111-1111-1111-1111-111111111111
"
)
...
...
@@ -119,10 +118,10 @@ def mock_worker_run_api(responses):
"
model_version_id
"
:
None
,
"
dataimport_id
"
:
"
0e6053d5-0d50-41dd-88b6-90907493c433
"
,
"
worker
"
:
{
"
id
"
:
"
497f6eca-6276-4993-bfeb-53cbbbba6f08
"
,
"
name
"
:
"
string
"
,
"
type
"
:
"
string
"
,
"
slug
"
:
"
string
"
,
"
id
"
:
"
deadbeef-1234-5678-1234-worker
"
,
"
name
"
:
"
Fake worker
"
,
"
slug
"
:
"
fake_worker
"
,
"
type
"
:
"
classifier
"
,
},
"
configuration_id
"
:
"
af0daaf4-983e-4703-a7ed-a10f146d6684
"
,
"
worker_version
"
:
{
...
...
@@ -153,7 +152,7 @@ def mock_worker_run_api(responses):
},
"
process
"
:
{
"
name
"
:
None
,
"
id
"
:
"
aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff
"
,
"
id
"
:
"
0e6053d5-0d50-41dd-88b6-90907493c433
"
,
"
state
"
:
"
running
"
,
"
mode
"
:
"
workers
"
,
"
corpus
"
:
"
11111111-1111-1111-1111-111111111111
"
,
...
...
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