Skip to content

Commit

Permalink
update docs with grouped image locations (#1384)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul S. Schweigert <[email protected]>
  • Loading branch information
psschwei authored Jul 10, 2024
1 parent 492ab29 commit 3c5f801
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion client/tests/resources/test-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
testrayhead:
container_name: testrayhead
image: icr.io/quantum-public/qiskit-serverless-ray-node:latest-py310
image: icr.io/quantum-public/qiskit-serverless/ray-node:latest-py310
entrypoint: [
"ray", "start", "--head", "--port=6379",
"--dashboard-host=0.0.0.0", "--block"
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/custom_function/Sample-Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM icr.io/quantum-public/qiskit-serverless-ray-node:0.12.0-py310
FROM icr.io/quantum-public/qiskit-serverless/ray-node:0.12.0-py310

# install all necessary dependencies for your custom image

Expand Down
24 changes: 8 additions & 16 deletions docs/deployment/deploying_custom_image_function.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In this tutorial we will describe how to build custom docker image for function.

In this tutorial we will be following 3 steps to deploy our function with custom docker image:

* implement function template
* implement function template
* define dockerfile, build it and push to registry
* upload

Expand All @@ -20,7 +20,7 @@ All of our custom image files will be located in a folder `custom_function`, whi
/runner.py
/Dockerfile
First we will implement function entrypoint by following template. All functions with custom docker images must follow same template structure.
First we will implement function entrypoint by following template. All functions with custom docker images must follow same template structure.

We need to create class `Runner` and implement `run` method that will be called during invocation of the function and results of the run method will be returned as result of the function.

Expand All @@ -43,14 +43,14 @@ Let's create `runner.py` file with following content
As a next step let's define and build our custom docker image.

Dockerfile will be extending base serverless node image and adding required packages and structure to it.
Dockerfile will be extending base serverless node image and adding required packages and structure to it.

In our simple case it will look something like this

.. code-block::
:caption: Dockerfile for custom image function.
FROM icr.io/quantum-public/qiskit-serverless-ray-node:0.12.0-py310
FROM icr.io/quantum-public/qiskit-serverless/ray-node:0.12.0-py310
# install all necessary dependencies for your custom image
Expand Down Expand Up @@ -152,7 +152,7 @@ Function example (runner.py)
return custom_function(arguments)
Dockerfile

.. code-block::
:caption: Dockerfile
Expand All @@ -171,7 +171,7 @@ Dockerfile
USER $RAY_UID
Build container image

.. code-block::
:caption: Docker build
Expand Down Expand Up @@ -237,7 +237,7 @@ List all available functions
print()
Execute Function

.. code-block::
:caption: usage.py
Expand All @@ -248,7 +248,7 @@ Execute Function
from qiskit.quantum_info import SparsePauliOp
from qiskit_ibm_runtime import QiskitRuntimeService
# set this True for the real Quantum system use
# set this True for the real Quantum system use
use_service=False
service = None
Expand All @@ -272,11 +272,3 @@ Execute Function
print(job.result())
print(job.logs())
6 changes: 3 additions & 3 deletions gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gateway is a set of apis that are used as a backend for providers.
### Build image

```shell
docker build -t qiskit/qiskit-serverless-gateway:<VERSION> .
docker build -t qiskit/qiskit-serverless/gateway:<VERSION> .
```

### Env variables for container
Expand All @@ -24,13 +24,13 @@ docker build -t qiskit/qiskit-serverless-gateway:<VERSION> .
| SETTINGS_TOKEN_AUTH_TOKEN_FIELD | user field name for custom token authentication mechanism. Default `apiToken`. |
| SETTINGS_AUTH_MECHANISM | authentication backend mechanism. Default `mock_token`. Options: `mock_token` and `custom_token`. If `custom_token` is selected then `SETTINGS_TOKEN_AUTH_URL` must be set. |
| SETTINGS_TOKEN_AUTH_VERIFICATION_URL | URL for custom token verificaiton |
| SETTINGS_TOKEN_AUTH_VERIFICATION_FIELD | name of a field to use for token verification |
| SETTINGS_TOKEN_AUTH_VERIFICATION_FIELD | name of a field to use for token verification |
| RAY_KUBERAY_NAMESPACE | namespace of kuberay resources. Should match kubernetes namespace |
| RAY_NODE_IMAGE | Default node image that will be launched on ray cluster creation |
| RAY_CLUSTER_MODE_LOCAL | 0 or 1. 1 for local mode (docker compose), 0 for cluster mode where clusters will be created by kuberay |
| RAY_CLUSTER_MODE_LOCAL_HOST | if `RAY_CLUSTER_MODE_LOCAL` set to 1, then this host for ray head node will be used to run all workloads |
| LIMITS_JOBS_PER_USER | number of concurrent programs/jobs user can run at single point of time |
| LIMITS_MAX_CLUSTERS | number of compute resources can be allocated in single point of time |
| LIMITS_MAX_CLUSTERS | number of compute resources can be allocated in single point of time |
| RAY_CLUSTER_TEMPLATE_CPU | default compute kuberay template cpu setting |
| RAY_CLUSTER_TEMPLATE_MEM | default compute kuberay template memory setting |
| RAY_CLUSTER_WORKER_REPLICAS | worker replicas per cluster |
Expand Down
2 changes: 1 addition & 1 deletion gateway/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
),
}
RAY_NODE_IMAGE = os.environ.get(
"RAY_NODE_IMAGE", "icr.io/quantum-public/qiskit-serverless-ray-node:0.12.0-py310"
"RAY_NODE_IMAGE", "icr.io/quantum-public/qiskit-serverless/ray-node:0.12.0-py310"
)
RAY_NODE_IMAGES_MAP = {
"default": RAY_NODE_IMAGE,
Expand Down

0 comments on commit 3c5f801

Please sign in to comment.