Skip to content

Quick Start

Quickstart

Install gc-ssf:

pip install git+https://git@github.com/graphcore/simple-server-framework.git

Run a demonstration:

gc-ssf  --config 'https://github.com/graphcore/simple-server-framework.git|examples/simple/ssf_config.yaml' init build run

This should start with lines that are similar to:

2023-10-19 12:28:49,635 414627     INFO      > Repo https://github.com/graphcore/simple-server-framework.git (cli.py:632)
2023-10-19 12:28:49,635 414627     INFO      > Repo dir .repo (cli.py:633)
2023-10-19 12:28:49,635 414627     INFO      > Repo name simple-server-framework (cli.py:634)
2023-10-19 12:28:49,635 414627     INFO      > Config .repo/simple-server-framework/examples/simple/ssf_config.yaml (cli.py:635)
2023-10-19 12:28:49,635 414627     INFO      > Config file examples/simple/ssf_config.yaml (cli.py:636)
2023-10-19 12:28:49,635 414627     INFO      > Checkout None (cli.py:637)
2023-10-19 12:28:49,635 414627     INFO      > Cloning repo (cli.py:648)

This shows SSF cloning the target application repository (https://github.com/graphcore/simple-server-framework.git) to your local .repo directory. For this quickstart demonstration, we are runing an example from the SSF repository itself.

After cloning the repository, SSF will build and run the example application (examples/simple/ssf_config.yaml)

Look for lines later in the output that are similar to:

2023-10-19 12:28:53,013 414627     INFO      > ==== Run ==== (run.py:23)
2023-10-19 12:28:53,014 414627     INFO      > Starting fastapi runtime with .repo/simple-server-framework/examples/simple/ssf_config.yaml (run.py:41)
2023-10-19 12:28:53,019 414627     INFO      > Address 10.3.49.180:8100 (run.py:46)

This tells you the address and port on which the application end-points have been started.

The trace should end with lines that are similar to:

2023-10-19 12:28:53,742 414687     INFO      instance=<simple-test.MyApplication object at 0x7f4b20f29460> (dispatcher.py:188)
2023-10-19 12:28:53,742 414687     INFO      > [0] Running app from /nethome/demo/workspace/ssf/.repo/simple-server-framework/examples/simple (dispatcher.py:189)
2023-10-19 12:28:53,742 414687     INFO      > [0] Startup user application instance (dispatcher.py:193)
2023-10-19 12:28:53,742 414687     INFO      MyApp startup (my_application.py:20)
2023-10-19 12:28:54,453 414627     INFO      Dispatcher ready (dispatcher.py:542)
2023-10-19 12:28:58,748 414687     INFO      [0] Dispatcher polling application replica watchdog (dispatcher.py:242)

This shows that the application has started and the dispatcher object through which calls (requests) to the application are made is ready.
You will see repeated polls of the application watchdog while the end-point is idle; this is the SSF built-in watchdog feature. See watchdog for further details.

Use a browser to open the endpoint docs with the format http://<address>/docs, for example http://10.3.49.180:8100/docs.

Tip:
If you are using Visual Studio Code with a remote connection to your development host then you can use the Port forwarding feature to add the served port (8100 in this example) and browse the endpoint directly in your VSC client using the built-in simple browser.

Next steps

Read installation for more detailed options for installing SSF and its pre-requisites.

Read the walkthrough for a complete example of the full workflow for developing your own application, including packaging and deployment.

Read model format for an overview of the SSF model application interface.

Read usage for an overview of the SSF command line interface.

Read features and advanced use for more complex use cases and examples.