Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wsd
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nlpworkers
wsd
Commits
e8d23f5f
Commit
e8d23f5f
authored
3 years ago
by
Grzegorz Kostkowski
Browse files
Options
Downloads
Patches
Plain Diff
Change entrypoint to always download model
parent
c4e1c8c5
No related merge requests found
Pipeline
#4135
passed with stage
in 11 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
entrypoint.sh
+11
-8
11 additions, 8 deletions
entrypoint.sh
with
11 additions
and
8 deletions
entrypoint.sh
+
11
−
8
View file @
e8d23f5f
#!/bin/sh
# Script downloads models defined in config file and starts worker.
# Script downloads models defined in config file and starts worker.
# Script should be called inside a container.
config_file
=
'/home/worker/config.ini'
# for now, name of file won't be changed so it's ok to use hardcoded value
model_filename
=
'merged_graph.xml.gz'
model_filename
=
'merged_graph.xml.gz'
# Simple function to retireve value for given key from ini file.
# Note that key should be unique, it does not handle sections
...
...
@@ -33,12 +33,15 @@ cd "$model_dir"
model_dir
=
$(
get_ini_value
"
$config_file
"
"model_dir"
)
model_url
=
$(
get_ini_value
"
$config_file
"
"model_url"
)
if
[
!
-f
"
$model_filename
"
]
;
then
echo
"Downloading a model '
$model_filename
' from '
$model_url
' ..."
remote_model_name
=
"
$model_filename
"
'.zip'
# assuming it is a zip archive
wget
-O
"
$remote_model_name
"
"
$model_url
"
unzip
"
$remote_model_name
"
;
rm
"
$remote_model_name
"
echo
"Done!"
if
[
-f
"
$model_filename
"
]
;
then
echo
"Removing old model ..."
rm
-f
"
$model_filename
"
fi
echo
"Downloading a model '
$model_filename
' from '
$model_url
' ..."
remote_model_name
=
"
$model_filename
"
'.zip'
# assuming it is a zip archive
wget
-O
"
$remote_model_name
"
"
$model_url
"
unzip
"
$remote_model_name
"
;
rm
"
$remote_model_name
"
echo
"Done!"
cd
/home/worker
&&
python3.6 main.py
This diff is collapsed.
Click to expand it.
Preview
0%
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