New UbiOps features January 2023

By 10 January 2023January 11th, 2023Functionality, Product update, UbiOps

UbiOps release news – version 2.21.0

On the 10th of January 2023 we have released new functionality and made improvements to our UbiOps SaaS product. On this page you can read all about it.

We have also prepared a release demo for you!

✔️ New file system

To improve working with files in UbiOps we introduced a completely new file system in this release. It is now much easier to manage your files in UbiOps and to make use of persistent storage. The new system also supports use of files larger than 512MB as input or output of deployments and pipelines, opening up new possibilities.

Files are organized in storage buckets within projects. You can create new buckets which are hosted on UbiOps, or you can connect UbiOps to your own buckets in either AWS, Google or Azure. Every project will have a default bucket hosted on UbiOps by default, which every deployment and pipeline in the project can access.

Files are passed to and from deployments in the form of file URI’s that are formatted as follows: ubiops-file://{bucket-name}/{path-to-file-in-bucket}. The UbiOps Python client library contains utility functions which can help you with uploading and downloading files in the new system. Below you can see an example of uploading and downloading a file.

1 import ubiops
2 configuration = ubiops.Configuration()
3 # Configure API token authorization
4 configuration.api_key['Authorization'] = 'Token <YOUR_API_TOKEN>'
5 api_client = ubiops.ApiClient(configuration)
6
7 project_name = '<YOUR PROJECT NAME>'
8 bucket_name = 'default'
9 file_input = 'file_example.png'
10
11 # Upload a file
12 file_uri = ubiops.utils.upload_file(api_client, project_name, file_input, bucket_name)
13
14 # Define request data with file
15 data = {'file_input': file_uri}
16
17 api_client.deployment_version_requests_create(
18  project_name=project_name,
19  deployment_name='file-example-deployment',
20  version='v1',
21  data=data
22 )
23
24 # Download a file from request response
25 ubiops.utils.download_file(
26  api_client,
27  project_name,
28  file_uri=response.result['file_output'],
29  output_path='.',
30  stream=True,
31  chunk_size=8192
32  )

For full information on the new file system please see working with files.

If you have deployments or pipelines that are currently using blobs as input or output that you want to upgrade to the use the new system, please see upgrading to the new file system.

✔️ Option to cancel builds or to trigger a rebuild

With this release we introduced more control of builds. When you create a new deployment version or revision, you now have the possibility to cancel the build. In addition, we also added the option to trigger rebuilds of a specific revision. The latter can be found in the revisions tab.

✔️ User id now passed to deployment context

For identity propagation purposes we now pass the user_id of the user that triggered a request to the deployment context. If you need the user_id in your deployment code you can use the following:

1def request(self, data, context):
2
3 print(f"User id: {context['user_id']}")
4

If you want to access the user_id please make sure to add the context parameter to the request function.

Did you know that there are other context parameters available as well? Next to user_id the context dictionary also contains the id (request ID) and the request_mode.

✔️ Updates to available languages

We have made some updates to our available languages:

  • We now support Python 3.11

  • If you are using GPUs we now have instances available with Python 3.9 and CUDA 11.2.2, and Python 3.10 and CUDA 11.2.2 This way you can use the latest versions of Tensorflow without the need of installing a different CUDA version with a ubiops.yaml. See Tensorflow’s CUDA compatibility for more.

✔️ On error policy for pipeline objects

Before, whenever a pipeline object failed during a pipeline request, the entire request would fail and raise an error. Sometimes you might want the pipeline to just continue though after a failed object. This is now possible by changing the on error policy of a pipeline object! There are three options:

  • Raise

  • Stop

  • Continue

Raise is the default behavior, it will raise the error and stop the pipeline, resulting in a failed request. With “stop” the pipeline will stop after the failed object and the objects later on int he pipeline will not be triggered, but the error will not be raised. This way the pipeline request will still have status success. “Continue” will simply continue the pipeline and not raise an error. The output of the failed object will be set to “none” when continue is enabled.

Have fun using the new file system in UbiOps!

Do you need more information? Head over to our documentation, or send us a message.