-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(api): Add infrastructure for a br2-external tree for buildroot #3217
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Configuration for Buildroot integration | ||
source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/api/Config.in" | ||
# source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/update-server/Config.in" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
config BR2_PACKAGE_PYTHON_OPENTRONS_API | ||
bool "python-opentrons-api" | ||
depends on BR2_PACKAGE_PYTHON3 | ||
select BR2_PACKAGE_PYTHON_NUMPY # runtime | ||
select BR2_PACKAGE_PYTHON_SERIAL # runtime | ||
select BR2_PACKAGE_PYTHON_URWID # runtime | ||
select BR2_PACKAGE_PYTHON_AIOHTTP # runtime | ||
help | ||
Opentrons API server. Controls an OT2 robot. | ||
|
||
https://opentrons.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
################################################################################ | ||
# | ||
# python-opentrons-api | ||
# | ||
################################################################################ | ||
|
||
# Get a key from package.json (like version) | ||
define get_pkg_json_key | ||
$(shell python -c "import json; print(json.load(open('$(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH)/api/src/opentrons/package.json'))[\"$(1)\"])") | ||
endef | ||
|
||
PYTHON_OPENTRONS_API_VERSION = $(call get_pkg_json_key,version) | ||
PYTHON_OPENTRONS_API_LICENSE = $(call get_pkg_json_key,license) | ||
PYTHON_OPENTRONS_API_LICENSE_FILES = $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH)/LICENSE | ||
PYTHON_OPENTRONS_API_SETUP_TYPE = setuptools | ||
PYTHON_OPENTRONS_API_SITE_METHOD = local | ||
PYTHON_OPENTRONS_API_SITE = $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH) | ||
PYTHON_OPENTRONS_API_SUBDIR = api | ||
PYTHON_OPENTRONS_API_POST_INSTALL_TARGET_HOOKS = PYTHON_OPENTRONS_API_INSTALL_VERSION | ||
|
||
define DUMP_BR_VERSION | ||
$(shell python 2>&1 $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH)/api/build_tools.py dump_br_version) | ||
endef | ||
|
||
define PYTHON_OPENTRONS_API_INSTALL_VERSION | ||
echo '$(call DUMP_BR_VERSION)' > $(BINARIES_DIR)/opentrons-api-version.json | ||
endef | ||
|
||
ot_api_name := python-opentrons-api | ||
|
||
define PYTHON_OPENTRONS_API_INSTALL_INIT_SYSTEMD | ||
$(INSTALL) -D -m 0644 $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH)/api/opentrons-api-server.service \ | ||
$(TARGET_DIR)/etc/systemd/system/opentrons-api-server.service | ||
|
||
mkdir -p $(TARGET_DIR)/etc/systemd/system/opentrons.target.wants | ||
|
||
ln -sf ../opentrons-api-server.service \ | ||
$(TARGET_DIR)/etc/systemd/system/opentrons.target.wants/opentrons-api-server.service | ||
endef | ||
|
||
# Calling inner-python-package directly instead of using python-package macro | ||
# because our directory layout doesn’t conform to buildroot’s expectation of | ||
# having the directory name be the package name | ||
$(eval $(call inner-python-package,python-opentrons-api,$(call UPPERCASE,$(ot_api_name)),$(call UPPERCASE,$(ot_api_name)),target)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Opentrons API server | ||
Requires=nginx.service | ||
After=nginx.service | ||
|
||
[Service] | ||
Type=exec | ||
ExecStart=python -m opentrons.main -U /run/aiohttp.sock | ||
Environment=OT_SMOOTHIE_ID=AMA | ||
|
||
[Install] | ||
WantedBy=opentrons.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name: OPENTRONS_MONOREPO | ||
desc: Tree containing Opentrons API and update infrastructure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Makefile inclusions for buildroot integration | ||
include $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH)/api/buildroot.mk | ||
# include $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH)/update-server/buildroot.mk | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment meant to be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could delete it if you want, it's mostly a memory aid for when we add the update server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope you can keep it in if it's useful for relevant work later on.