Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
/ pyansys-helloworld Public archive

Demonstrate how to create a basic pyansys service package

Notifications You must be signed in to change notification settings

ansys/pyansys-helloworld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansys Python gRPC Examples

The following examples demonstrate how to create a basic pyansys server/client package following both Google and Ansys's recommendations regarding gRPC.

The main aim of these examples is to demonstrate any Ansys specific tools, packaging, or paradigms designed to make it easier to build, maintain, and deliver services.

For all other documentation, reference the official documentation at gRPC.

Directory Description

Every gRPC service contains a Server and Client with a proto file or files describing the services exposed by the service. This example contains the minimum components necessary to install a greeter service and client package to demonstrate how to package and run a basic service.

Installing and Running this Service

  1. First, visit the protos directory and follow the instructions there to build the proto package from the example proto files.

  2. Install the server within the server directory by following the README there. This relies on the package you built from the previous step; please be sure you installed that.

  3. Install the client within the client directory by following the README there. This also relies on the proto package you built from the previous step; please be sure you installed that.

Once you have the server and client installed on your local environment, startup the server with:

python -m ansys.examples.greeter_server

Then, within a different terminal, start the client with:

python -m ansys.examples.greeter_client

If everything worked out, the client should start, connect to the server and print:

Greeter client received: Hello, you!

For further details, see the READMEs within the proto, server, or client directories.

Packages

If you want to just want to run the greeter example without building any of the packages, you can download the source distributions from Releases. Please follow the directions in the release.

Notes

Regarding versioning, note that python packages must use semantic versioning. As the gRPC service version is insuffient, gRPC packages from auto-generated from the proto files contain an additional VERSION file that tracks the semantic version of the service definition. Please see the documentation and reasoning behind this at pyansys-protos-generator.

About

Demonstrate how to create a basic pyansys service package

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages