Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
model_server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Christopher Randolph Rhodes
model_server
Commits
7b1c2aff
Commit
7b1c2aff
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Added retry mechanism to status confirmation, to address suspect timeout problem
parent
5b13c794
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+3
-4
3 additions, 4 deletions
README.md
model_server/scripts/run_server.py
+9
-1
9 additions, 1 deletion
model_server/scripts/run_server.py
with
12 additions
and
5 deletions
README.md
+
3
−
4
View file @
7b1c2aff
...
...
@@ -10,10 +10,9 @@ model_server implement image analysis jobs for online use (e.g. in feedback micr
`cd %userprofile%`
<br>
`git clone https://almf-staff:KJmFvyPRbpzoVZDqfMzV@git.embl.de/rhodes/model_server.git`
5.
Open the newly created project root:
`cd model_server`
6.
Create the environment:
`mamba create -n model_server_env --override-channels -c pytorch -c ilastik-forge -c conda-forge ilastik`
7.
In the same terminal, run:
`mamba init`
8.
Now close and re-open the terminal:
`Miniforge3 > Miniforge Prompt`
9.
Now activate the environment:
`mamba activate model_server_env`
6.
Create the environment:
`mamba env create --file requirements.yml --name model_server_env`
7.
Activate the environment:
`mamba activate model_server_env`
8.
# Examples
...
...
This diff is collapsed.
Click to expand it.
model_server/scripts/run_server.py
+
9
−
1
View file @
7b1c2aff
import
argparse
from
multiprocessing
import
Process
import
requests
from
requests.adapters
import
HTTPAdapter
from
urllib3
import
Retry
import
uvicorn
import
webbrowser
...
...
@@ -48,7 +50,13 @@ if __name__ == '__main__':
server_process
.
start
()
try
:
resp
=
requests
.
get
(
url
)
sesh
=
requests
.
Session
()
retries
=
Retry
(
total
=
5
,
backoff_factor
=
0.1
,
)
sesh
.
mount
(
'
http://
'
,
HTTPAdapter
(
max_retries
=
retries
))
resp
=
sesh
.
get
(
url
)
assert
resp
.
status_code
==
200
except
Exception
:
print
(
'
Error starting server
'
)
...
...
This diff is collapsed.
Click to expand it.
Christopher Randolph Rhodes
@rhodes
mentioned in commit
86505182
·
1 year ago
mentioned in commit
86505182
mentioned in commit 86505182adc6ff0e2ad094fd92528d6c19e4487b
Toggle commit list
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