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

Validated instructions to install package

parent 519ff9ca
No related branches found
No related tags found
2 merge requests!65Release 2024.10.01,!64Build 2024.10.01
......@@ -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.
......@@ -21,20 +21,31 @@ with open(root / 'channeldata.json', 'r') as fh:
chdata = json.load(fh)
# upload to GitLab API
res = []
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]
pkgname = f'conda_{sd}'
res.append(
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},
)
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