How to Manage Jina Resources with Namespace

With Jina AI Cloud's user namespaces, all users can have their own DocumentArrays and Executors with the same name, with no fear of naming conflicts.

Colorful gradient background with the Jina logo and the text "Cloud" highlighting software identity
With Jina AI Cloud's user namespaces, all users can have their own DocumentArrays (or Executors) with the same name, with no fear of naming conflicts.

Over the past year, we’ve been rapidly expanding Jina AI Cloud, starting with our Executor Hub, and now encompassing DocumentArray storage, hosted Flows and cloud apps.

Jina AI Cloud
The most advanced MLOps platform for multimodal AI, neural search and creative AI

That’s a lot of stuff to manage! We’re introducing user namespaces to make things easier for all our users.

Namespace

Previously, if Alice and Bob both wanted to push a DocumentArray called fashion-mnist, whoever pushed first would get the name. That means Bob might have to go with fashion-mnist2 or similar. With more people using Jina AI Cloud, naming conflicts could become commonplace.

With user namespaces, both Alice and Bob can have their own fashion_mnist DocumentArrays (or Executors with the same name) with no fear of naming conflicts.

The new namespace apply to two important resources inside Jina AI ecosystem: DocumentArray and Executor.

Schema

Moving forwards, names for DocumentArrays and Hub Executors will follow the new schema, namespace/resource:

Old New
DocumentArray Push/Pull
fashion_mnist
alice/fashion_mnist
Executors Push/Pull
jinahub://MyExecutor:<secret>
jinaai://alice/MyExecutor
Containerized Executors Push/Pull
jinahub+docker://MyExecutor:<secret>
jinaai+docker://alice/MyExecutor
💡
Note that Executors now use jinaai:// as the prefix (not jinahub://) and no longer need secrets (as you already logged in).

Access scope

For both DocumentArray and Executor, the user enjoys the following accessibility:

Action Own namespace (alice/*) Other's namespace bob/*
Push Yes No
Pull Yes Yes (if Bob pushed it as public)
docarray.array.mixins.io.pushpull module
DocArray is a library for nested, unstructured data such as text, image, audio, video, 3D mesh. It allows deep learning engineers to easily preprocess, embed, search, recommend and transfer the data.
Push a DocumentArray publicly
Publish
If you want to share your Executor, you can push it to Executor Hub. There are two ways to share: Public(default): Anyone can use public Executors without any restrictions., Private: Only people with the secret can use private Executors.. Publishing for the first time: If you have logged into Jin...
Push an Executor publicly

Does this break anything?

  • There are no breaking changes for existing Executors on Executor Hub.
  • You can still pull old DocumentArrays by their original name, but you can’t update them. Newly-pushed DocumentArrays must follow the username/da-name scheme.

Managing your resources under the namespace

Manage DocumentArrays

  1. Create a Jina AI account at cloud.jina.ai.

2. Upgrade docarray to >=0.19.1 version with pip install -U docarray.

3. Log in via docarray.login() and start pushing and pulling DocumentArrays:

from docarray import DocumentArray

docarray.login()  # log in as 'alice'

docs = DocumentArray.pull('alice/fashion_mnist')

docs.push('alice/fashion_mnist_updated')

4. Manage your pushed DocumentArrays on Jina AI Cloud in the "Storage" tab:

Untitled

Manage Executors

Upgrade jina to the latest version with pip install -U jina.

  1. Create a Jina AI account at cloud.jina.ai.
  2. Use an existing Executor in your Flow (in Python):
from jina import Flow

flow = Flow().add(uses='jinaai+docker://alice/MyExecutor')  # note jinaai

with flow:
    ...

4. Or push your own Executor to Executor Hub (from the CLI):

jina auth login
jina hub push MyExecutor

5. Manage your Executors on Executor Hub on the "Executors" tab: