arkitektio / arkitekt Goto Github PK
View Code? Open in Web Editor NEWarkitekt is the python api client for the arkitekt-framework
Home Page: https://arkitekt.live
License: MIT License
arkitekt is the python api client for the arkitekt-framework
Home Page: https://arkitekt.live
License: MIT License
It seems there is something missing for the inspect part of my Dockerfile (see below) although the build is working
Dockerfile
FROM nvidia/cuda:12.3.1-runtime-ubuntu22.04
RUN apt update && apt install -y python3 python3-pip nvidia-opencl-dev clinfo nvidia-opencl-icd-384
RUN pip install "arkitekt[all]"
RUN pip install pyclesperanto-prototype
RUN mkdir /app
WORKDIR /app
COPY .arkitekt /app/.arkitekt
COPY app.py /app/app.py
Error:
Traceback (most recent call last):
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/arkitekt/cli/commands/port/build.py", line 106, in inspect_definitions
output = json.loads(result.stdout)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/bin/arkitekt", line 8, in <module>
sys.exit(cli())
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/rich_click/rich_command.py", line 126, in main
rv = self.invoke(ctx)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/arkitekt/cli/commands/port/build.py", line 221, in build
inspection = inspect_build(build_tag)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/arkitekt/cli/commands/port/build.py", line 133, in inspect_build
definitions = inspect_definitions(build_id)
File "/home/aschroeter/miniconda3/envs/pyclesperanto-arkitekt/lib/python3.9/site-packages/arkitekt/cli/commands/port/build.py", line 109, in inspect_definitions
raise InspectionError(
arkitekt.cli.commands.port.build.InspectionError: Could not decode JSON output of docker inspect.
==========
== CUDA ==
==========
CUDA Version 12.3.1
Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.
Use the NVIDIA Container Toolkit to start this container with GPU support; see
https://docs.nvidia.com/datacenter/cloud-native/ .
{"definitions": [{"description": "Computes the absolute value of every individual pixel x in a given image.\n\nf(x) = |x|", "collections": [], "name": "absolute", "portGroups": [], "args": [{"identifier": "@mikro/representation", "key": "source", "scope": "GLOBAL", "label": "source", "kind": "STRUCTURE", "description": "The input image to be processed.", "assignWidget": {"kind": "SearchWidget", "query": "query search_representation($search: String, $values: [ID]) {\n options: representations(name: $search, limit: 20, ids: $values) {\n value: id\n label: name\n }\n}", "ward": "mikro"}, "nullable": false}], "returns": [{"identifier": "@mikro/representation", "key": "return0", "scope": "GLOBAL", "kind": "STRUCTURE", "assignWidget": {"kind": "SearchWidget", "query": "query search_representation($search: String, $values: [ID]) {\n options: representations(name: $search, limit: 20, ids: $values) {\n value: id\n label: name\n }\n}", "ward": "mikro"}, "nullable": false}], "interfaces": [], "kind": "FUNCTION"}, {"description": "No Description", "collections": [], "name": "test", "portGroups": [], "args": [{"identifier": "@mikro/representation", "key": "source", "scope": "GLOBAL", "kind": "STRUCTURE", "assignWidget": {"kind": "SearchWidget", "query": "query search_representation($search: String, $values: [ID]) {\n options: representations(name: $search, limit: 20, ids: $values) {\n value: id\n label: name\n }\n}", "ward": "mikro"}, "nullable": false}], "returns": [{"identifier": "@mikro/representation", "key": "return0", "scope": "GLOBAL", "kind": "STRUCTURE", "assignWidget": {"kind": "SearchWidget", "query": "query search_representation($search: String, $values: [ID]) {\n options: representations(name: $search, limit: 20, ids: $values) {\n value: id\n label: name\n }\n}", "ward": "mikro"}, "nullable": false}], "interfaces": [], "kind": "FUNCTION"}, {"description": "No Description", "collections": [], "name": "create voronoi labels", "portGroups": [], "args": [{"identifier": "@mikro/representation", "key": "representation", "scope": "GLOBAL", "label": "representation", "kind": "STRUCTURE", "assignWidget": {"kind": "SearchWidget", "query": "query search_representation($search: String, $values: [ID]) {\n options: representations(name: $search, limit: 20, ids: $values) {\n value: id\n label: name\n }\n}", "ward": "mikro"}, "nullable": false}], "returns": [{"identifier": "@mikro/representation", "key": "return0", "scope": "GLOBAL", "kind": "STRUCTURE", "description": "A string with Hello {n}", "assignWidget": {"kind": "SearchWidget", "query": "query search_representation($search: String, $values: [ID]) {\n options: representations(name: $search, limit: 20, ids: $values) {\n value: id\n label: name\n }\n}", "ward": "mikro"}, "nullable": false}], "interfaces": [], "kind": "FUNCTION"}, {"description": "No Description", "collections": [], "name": "create voronoi labels", "portGroups": [], "args": [{"identifier": "@mikro/representation", "key": "representation", "scope": "GLOBAL", "label": "representation", "kind": "STRUCTURE", "assignWidget": {"kind": "SearchWidget", "query": "query search_representation($search: String, $values: [ID]) {\n options: representations(name: $search, limit: 20, ids: $values) {\n value: id\n label: name\n }\n}", "ward": "mikro"}, "nullable": false}, {"key": "radius_x", "scope": "GLOBAL", "kind": "INT", "default": 5, "nullable": true, "annotations": []}, {"key": "radius_y", "scope": "GLOBAL", "kind": "INT", "default": 5, "nullable": true, "annotations": []}, {"key": "spot_sigma", "scope": "GLOBAL", "kind": "INT", "default": 1, "nullable": true, "annotations": []}, {"key": "radius", "scope": "GLOBAL", "kind": "INT", "default": 10, "nullable": true, "annotations": []}], "returns": [{"identifier": "@mikro/representation", "key": "return0", "scope": "GLOBAL", "kind": "STRUCTURE", "description": "A string with Hello {n}", "assignWidget": {"kind": "SearchWidget", "query": "query search_representation($search: String, $values: [ID]) {\n options: representations(name: $search, limit: 20, ids: $values) {\n value: id\n label: name\n }\n}", "ward": "mikro"}, "nullable": false}], "interfaces": [], "kind": "FUNCTION"}]}
Tried a fresh install but I get this error with python 3.12.
(arkitekt) aschroeter@Moriarty:~$ arkitekt
Traceback (most recent call last):
File "/home/aschroeter/mambaforge/envs/arkitekt/bin/arkitekt", line 5, in <module>
from arkitekt.cli.main import cli
File "/home/aschroeter/mambaforge/envs/arkitekt/lib/python3.12/site-packages/arkitekt/__init__.py", line 1, in <module>
from arkitekt.apps import Arkitekt
File "/home/aschroeter/mambaforge/envs/arkitekt/lib/python3.12/site-packages/arkitekt/apps/__init__.py", line 1, in <module>
from .default import Arkitekt
File "/home/aschroeter/mambaforge/envs/arkitekt/lib/python3.12/site-packages/arkitekt/apps/default.py", line 1, in <module>
from arkitekt.apps.connected import ConnectedApp
File "/home/aschroeter/mambaforge/envs/arkitekt/lib/python3.12/site-packages/arkitekt/apps/connected.py", line 1, in <module>
from arkitekt.apps.mikro import MikroApp
File "/home/aschroeter/mambaforge/envs/arkitekt/lib/python3.12/site-packages/arkitekt/apps/mikro.py", line 41, in <module>
from arkitekt.apps.herre import HerreApp
File "/home/aschroeter/mambaforge/envs/arkitekt/lib/python3.12/site-packages/arkitekt/apps/herre.py", line 1, in <module>
from arkitekt.apps.fakts import FaktsApp
File "/home/aschroeter/mambaforge/envs/arkitekt/lib/python3.12/site-packages/arkitekt/apps/fakts.py", line 4, in <module>
from fakts.grants.remote.device_code import DeviceCodeGrant
ModuleNotFoundError: No module named 'fakts.grants.remote.device_code'
To have an easy test case for the support of flavors I have created the test repository (https://github.com/alexschroeter/tensorflow-test).
These are the issues I have encountered:
Since the different vendors want different parameters passed to docker, we need the ability to add these parameters to the docker run command.
CUDA: docker run --gpus all <image>
ROCM: docker run --device=/dev/kfd --device=/dev/dri --group-add video <image>
DPC++: docker run --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path <image>
I believe the config.yaml
will be the right location for these docker_params
as I have called them in the example repository. I went looking through the code a bit and I was wondering if the selectors (https://github.com/arkitektio/arkitekt/blob/e8762476e08ec850d3e27d2a41b0c8c63863bbb3/arkitekt/cli/types.py#L343C30-L343C39) are meant to be for that or if this part is not there yet.
I am also wondering if you already passed --gpus all
for Nvidia somewhere or if this is not strictly necessary anymore and this is the reason I could not find it.
Related to the topic above I am wondering how to handle the selection of specific GPUs, and if you already had some thoughts regarding this. I believe for Nvidia and AMD you can pass [CUDA|HIP]_VISIBLE_DEVICES=[list of numbers] or something similar but I don't know yet where you would add this (Instantiation of the App) and how.
I believe this problem will be solved by adding the parameters to config.yaml
but I am wondering if build
should fail if the container cannot be started or if the build should work as long as the container can be built. As a side note, this issue only happened with the Intel container the other ones didn't fail if they couldn't find the GPU where the Intel one did.
I don't know if there are other reasons but for consistency, I believe publish
should publish all of them, and -f flavor
can be used to publish a certain flavor only. Right now, I have to work around it by building the one that I want to publish again and publish after, which takes the last one it seems.
I am unable to deploy in Port but I am wondering if this is because some containers (the Intel one) are missing or because I am using a version that doesn't support this yet.
Cheers,
Alex
This is related to Issue: #10
I don't know if there is any technical reason or if at the time 3.11 was just the latest available version.
Even without needing gpu capability I was unable to run arkitekt port stage
without the nvidia-container-toolkit. I believe this should probably be possible since some people might not even have nvidia GPUs installed.
Error when running without nvidia-container-toolkit
(arkitekt) aschroeter:~/src/arkitekt-matlab-example$ arkitekt port stage
Running inside docker: arkitekt-matlab-example:0.0.1
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container:
╭─ Error ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Docker container exited │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
To find out more, visit https://arkitekt.live
There is no LICENSE file, although the pyproject.toml
says CC BY-NC 3.0. However, CC BY-NC 3.0 is not an OSI-approved open source license, due to the non-commercial clause. It would be helpful to add LICENSE files to each of arkitekt's source repositories, and choose a license compatible with open source. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.