The Symbio Reference Application implements the minimal requirements for integrating with our automation framework.
activateis a symbolic link to a shared script that provides convenience functions for common tasks.app/contains the Python application code.bootstrapis a front-end for managing development environments.app/configuration/contains files used to control runtime behavior such as the workcell definition and logging.infrastructure/is a submodule that provides automation support.Jenkinsfileis a declarative pipeline that provides continuous integration and release automation.ui/contains the JavaScript code if the application has a user interface.
This section describes the process for creating new applications. Upon success, your will be able to:
- Create development environments using a downloaded or local version of SDCS.
- Verify changes with a pull request builder.
- Build, test, and publish development images.
- Build, test, and publish release candidates.
- Build, test, and publish releases.
To get started, message a member of the DevOps team to perform the following steps:
-
Click the button labeled Use this template. This will create a new repository with the same directory structure. Unlike creating a fork, the new repo will not retain the commit history.
-
Name the repository
CUSTOMER_CODENAME-APP_NAMEas ingemini-seating,mercury-wax, orsymbio-bolt_picking. Exclusively use-to separateCUSTOMER_CODENAMEfromAPP_NAME. Use_for multi-word names. This convention will sort repositories by owner and simplify programmatic parsing. Ensure that the new repository isPrivate(radial button is -
Go to the Settings tab of the new repository. Configure the sections Options, Manage Access, and Branches to match this repository with the following exception.
- Do not check 'Template repository' in the new repo.
To add a repository in ECR for the new application, refer to the Usage section of in Docker Image Repositories.
Once the repository has been created. Configure a multibranch pipeline to
build master, release branches, and pull requests.
- Click the tab that displays all jobs for the customer. If this is a new
customer, click the
+to create a new tab; enter the customer code name in the View name input box; selectMultiJob Viewfrom the list and press OK. - Click New Item on the lefthand side of the page.
- Check the box labeled Add to current view (next to the OK button).
- Set the name to the user friendly application name as in Gemini Seating, Mercury Wax, or Symbio Bolt Picking.
- At the bottom of the list, type
Reference Appin the box labeled Copy from.
- Create a branch.
- The
symbio-build-toolssubmodule ininfrastructureshould already be set up in the repository. If it isn't, it can be setup by running:
git submodule add ../../SymbioRobotics/symbio-build-tools.git infrastructure - Remove this content from
README.mdand set the user friendly application name. - Rename the directory
app/symbio_referencetoapp/CUSTOMER_CODENAME_APP_NAMEas ingemini_seating,mercury_wax, orsymbio_bolt_picking. - Find and replace references to
symbio_referencewith your project's root package name. - Create a pull request.
- Create and configure a ZenHub workspace with the user friendly application name.
.flake8specifies the rules and exclusions for linting Python code. The initial ruleset matches the rules for SDCS.- The target-specific variable
SBT_FLAKE8_ARGSinapp/Makefilespecifies which directories and files must conform to the rules specified in.flake8. .mypy.inispecifies the rules and exclusions for type annotations.- The target-specific variable
SBT_MYPY_ARGSinapp/Makefilespecifies which packages and modules must conform to the rules specified in.mypy.ini. Note thatmypyrelies on Python imports whileflake8uses the filesystem. Specifyexport SBT_MYPY_ARGS=to disablemypy.
- Unit, integration, and functional tests all use Pytest.
app/testscontains a subdirectory for each one with its ownpytest.inifor customizations.app/Makefilecontains a target for each one. You can disable a test suite by removing the appropriately-named target. While it may be sensible to disable integration or functional tests in some circumstances, please strive to run and maintain unit tests.
Jenkinsfileis a declarative pipeline that bootstraps, lints, and runs all automated test suites. Following the application setup directions will result in a single job that runs for all pull requests and merges tomaster.- Refer to the SDCS repo and the corresponding Jenkins jobs for an example of how to selectively run test suites via more elaborate triggers.
This project tests our automation and build systems, not SDCS or its
APIs. For example, its unit tests merely verify that imports work and pytest
runs with all of the bells and whistles. Revisions should primarily be motivated
by changes to Symbio Build Tools.