Skip to content
Snippets Groups Projects
Commit eabc5125 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Merge branch 'build-2024.10.01' into 'staging'

Build 2024.10.01

See merge request rhodes/model_server!64
parents b24dc03f 06519d6d
No related branches found
No related tags found
2 merge requests!65Release 2024.10.01,!64Build 2024.10.01
......@@ -5,5 +5,6 @@
# build and conda-build artifacts
build/*
conda-bld/*
dist/*
*.egg-info/*
\ No newline at end of file
# Default ignored files
/shelf/
/workspace.xml
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (model_server_env)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/model_server" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Python 3.9 (model_server_env)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/model_server.iml" filepath="$PROJECT_DIR$/.idea/model_server.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -8,19 +8,29 @@ model_server is a service for on-demand computer vision, adapted specifically to
and other life sciences applications. It abstracts image data access, persists machine learning models,
and exposes an extensible API to facilitate low-latency analysis.
## Installation from source:
## Install Git and miniforge
1. Install Miniforge for environment management:<br>https://github.com/conda-forge/miniforge/releases
2. Under the Start menu, open `Miniforge3 > Miniforge Prompt`
## Option 1: install model_server as a package:
1. Download the most recent version of the built package from:<br>https://git.embl.de/rhodes/model_server/-/packages/1280
2. (optional) activate the target conda environment: `mamba activate <target_environment>`
3. From the package repository https://git.embl.de/rhodes/model_server/-/packages/ download:
- The most recent requirements.yml
- The most recent .tar.bz2 file containing the built conda package
4. In a text editor, open requirements.yml and remove all but the "channels" and "dependencies" blocks, then save.
5. Change directories to the location of 'requirements.yml' and install dependencies:<br>`mamba env update -f requirements.yml`
6. Download the most recent .tar.bz2 file containing the built conda package from:<br>https://git.embl.de/rhodes/model_server/-/packages/1283
7. Change directories to the downloaded file and install model_server package: `mamba install model_server-<version>-py_0.tar.bz2`
## Option 2: install model_server from source:
1. Install Git:<br>https://git-scm.com/download/win
2. Install Miniforge for environment management:<br>https://github.com/conda-forge/miniforge/releases
3. Under the Start menu, open `Miniforge3 > Miniforge Prompt`
4. In the new terminal, clone the model_server repository:<br>
`cd %userprofile%`<br>
`git clone https://almf-staff:KJmFvyPRbpzoVZDqfMzV@git.embl.de/rhodes/model_server.git`
5. Create the environment: `mamba env create --file requirements.yml --name model_server_env`
6. Activate the environment: `mamba activate model_server_env`
7. Add the project source as a Python package: `pip install --no-deps -e .`
2. In the new terminal, clone the model_server repository:<br>`cd %userprofile%`<br>`git clone https://almf-staff:KJmFvyPRbpzoVZDqfMzV@git.embl.de/rhodes/model_server.git`
3. Create the target environment: `mamba env create --file requirements.yml --name model_server_env`
4. Activate the target environment: `mamba activate model_server_env`
5. Add the project source as a Python package: `pip install --no-deps -e .`
## To start the server:
1. From the Miniforge prompt, run `mamba activate model_server_env`
1. From the Miniforge prompt, run `mamba activate <target_environment>`
2. Then run `python -m scripts.run_server --port 6221`
3. A browser window should appear, with basic status information.
"""
Automate registration of conda build artifacts to EMBL GitLab;
assumes API access token is recorded in ~/.pypirc shell configuration file
"""
from configparser import ConfigParser
import json
from pathlib import Path
import requests
id = '5668'
proj = 'model_server'
root = Path('../conda-bld/')
# get authentication info from local config file
cfg = ConfigParser()
cfg.read(Path.home() / '.pypirc')
user = cfg['gitlab-model-server']['username']
pwd = cfg['gitlab-model-server']['password']
with open(root / 'channeldata.json', 'r') as fh:
chdata = json.load(fh)
# upload to GitLab API
res = {}
for sd in ['noarch', 'win-64']:
with open(root / sd / 'repodata.json', 'r') as fh:
dd = json.load(fh)
pkgname = f'conda_{sd}'
if len(dd['packages']) == 0:
continue
# put each .tar.bz2
for fn in dd['packages'].keys():
ver = dd['packages'][fn]['version']
stem = fn.split('.tar.bz2')[0]
res[(sd, fn)] = requests.put(
f'https://git.embl.de/api/v4/projects/{id}/packages/generic/{pkgname}/{ver}/{fn}?status=default',
files={'file': open(root / sd / fn, 'rb')},
headers={'PRIVATE-TOKEN': pwd},
)
# put requirements.yml
fn = 'requirements.yml'
res[(sd, fn)] = requests.put(
f'https://git.embl.de/api/v4/projects/{id}/packages/generic/{pkgname}/{ver}/{fn}?status=default',
files={'file': open(root.parent / fn, 'r')},
headers={'PRIVATE-TOKEN': pwd, 'Content-Type': 'text/html'},
)
print('Finished')
print(res)
\ No newline at end of file
name: model_server_mqtt
name: model_server
channels:
- pytorch
- ilastik-forge
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment