Programmatic Petrel access#

In this scenario you will be using a Hub Agent to start an application. In this specific example it will give you programmatic access to Petrel, but it is applicable to other apps as well. The Hub Agent has to run on the same machine you want to launch the Petrel application and be connected to the Hub Server. You can then use your Hub client application to send requests and tasks to the Hub Agent to list files, launch an application or execute scripts. It is assumed that the Hub Server is already configured for you. The configuration of the Hub Server will be done by the Hub admin in your organization if hosted on-prem or in-house. If you are using a Cegal hosted solution like Cegal Innovation Space the configuration of the Hub Server will be done by Cegal.

../../../_images/Hub_ProgrammaticPetrel.gif ../../../_images/Hub_ProgrammaticPetrel_dark.gif

We will discuss two different use cases in this section:

  • A Hub Agent is already running and connected to the Hub server. You are using a Hub client application to send requests to the Hub Agent

  • You will start a Hub Agent on your local machine to then connect from your remote Python environment.

Starting a Hub Agent on local machine#

A Hub Agent is required to run on the machine you want to launch a Petrel instance. The Hub Agent can be started in the Hub CLI. Once it is started it can live as a long-lived connection to use in future or be started for every connection.

The image below shows an example of how to start a Hub Agent from the CLI.

../../../_images/Hub_CLI_agent.png

Connecting to a running Hub Agent#

This notebook shows a workflow of how to launch a Petrel instance from a Python script on a remote network.

Now that the Hub connection is established you can start using other Prizm modules. An example of connecting to Petrel from a remote Hub Server can be found here: