Skip to content
Snippets Groups Projects
Unverified Commit 20065319 authored by dacannguyen01's avatar dacannguyen01 Committed by GitHub
Browse files

Initial commit

parents
Branches
Tags
No related merge requests found
Showing with 296 additions and 0 deletions
[bumpversion]
current_version = 0.0.0
files = .dtproject
commit = True
tag = True
# Ignore everything
**
# Allow files and directories
!assets
!packages
!dependencies-apt.txt
!dependencies-py3.*
!launchers
# YOUR FILES LISTED BELOW THIS LINE (IMPORTANT: PREPEND !)
# ----------------------------------------------------------------------------
VERSION=0.0.0
TYPE=template-basic
TYPE_VERSION=3
docs/build
*pyc
# documentation artifacts
html/*
!html/HTML_DOCS_WILL_BE_GENERATED_HERE
# otherwise CI thinks index not clean
*.resolved
# parameters
ARG REPO_NAME="<REPO_NAME_HERE>"
ARG DESCRIPTION="<DESCRIPTION_HERE>"
ARG MAINTAINER="<YOUR_FULL_NAME> (<YOUR_EMAIL_ADDRESS>)"
# pick an icon from: https://fontawesome.com/v4.7.0/icons/
ARG ICON="cube"
# ==================================================>
# ==> Do not change the code below this line
ARG ARCH
ARG DISTRO=daffy
ARG DOCKER_REGISTRY=docker.io
ARG BASE_IMAGE=dt-commons
ARG BASE_TAG=${DISTRO}-${ARCH}
ARG LAUNCHER=default
# define base image
FROM ${DOCKER_REGISTRY}/duckietown/${BASE_IMAGE}:${BASE_TAG} as base
# recall all arguments
ARG DISTRO
ARG REPO_NAME
ARG DESCRIPTION
ARG MAINTAINER
ARG ICON
ARG BASE_TAG
ARG BASE_IMAGE
ARG LAUNCHER
# - buildkit
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
# check build arguments
RUN dt-build-env-check "${REPO_NAME}" "${MAINTAINER}" "${DESCRIPTION}"
# define/create repository path
ARG REPO_PATH="${SOURCE_DIR}/${REPO_NAME}"
ARG LAUNCH_PATH="${LAUNCH_DIR}/${REPO_NAME}"
RUN mkdir -p "${REPO_PATH}" "${LAUNCH_PATH}"
WORKDIR "${REPO_PATH}"
# keep some arguments as environment variables
ENV DT_MODULE_TYPE="${REPO_NAME}" \
DT_MODULE_DESCRIPTION="${DESCRIPTION}" \
DT_MODULE_ICON="${ICON}" \
DT_MAINTAINER="${MAINTAINER}" \
DT_REPO_PATH="${REPO_PATH}" \
DT_LAUNCH_PATH="${LAUNCH_PATH}" \
DT_LAUNCHER="${LAUNCHER}"
# install apt dependencies
COPY ./dependencies-apt.txt "${REPO_PATH}/"
RUN dt-apt-install ${REPO_PATH}/dependencies-apt.txt
# install python3 dependencies
ARG PIP_INDEX_URL="https://pypi.org/simple"
ENV PIP_INDEX_URL=${PIP_INDEX_URL}
COPY ./dependencies-py3.* "${REPO_PATH}/"
RUN dt-pip3-install "${REPO_PATH}/dependencies-py3.*"
# copy the source code
COPY ./packages "${REPO_PATH}/packages"
# install launcher scripts
COPY ./launchers/. "${LAUNCH_PATH}/"
RUN dt-install-launchers "${LAUNCH_PATH}"
# define default command
CMD ["bash", "-c", "dt-launcher-${DT_LAUNCHER}"]
# store module metadata
LABEL org.duckietown.label.module.type="${REPO_NAME}" \
org.duckietown.label.module.description="${DESCRIPTION}" \
org.duckietown.label.module.icon="${ICON}" \
org.duckietown.label.platform.os="${TARGETOS}" \
org.duckietown.label.platform.architecture="${TARGETARCH}" \
org.duckietown.label.platform.variant="${TARGETVARIANT}" \
org.duckietown.label.code.location="${REPO_PATH}" \
org.duckietown.label.code.version.distro="${DISTRO}" \
org.duckietown.label.base.image="${BASE_IMAGE}" \
org.duckietown.label.base.tag="${BASE_TAG}" \
org.duckietown.label.maintainer="${MAINTAINER}"
# <== Do not change the code above this line
# <==================================================
File added
# Template: template-basic
This template provides a boilerplate repository for developing non-ROS software
in Duckietown.
**NOTE:** If you want to develop software that uses ROS, check out
[this template](https://github.com/duckietown/template-ros).
## How to use it
### 1. Fork this repository
Use the fork button in the top-right corner of the github page to fork this template repository.
### 2. Create a new repository
Create a new repository on github.com while
specifying the newly forked template repository as
a template for your new repository.
### 3. Define dependencies
List the dependencies in the files `dependencies-apt.txt` and
`dependencies-py3.txt` (apt packages and pip packages respectively).
### 4. Place your code
Place your code in the directory `/packages/` of
your new repository.
### 5. Setup launchers
The directory `/launchers` can contain as many launchers (launching scripts)
as you want. A default launcher called `default.sh` must always be present.
If you create an executable script (i.e., a file with a valid shebang statement)
a launcher will be created for it. For example, the script file
`/launchers/my-launcher.sh` will be available inside the Docker image as the binary
`dt-launcher-my-launcher`.
When launching a new container, you can simply provide `dt-launcher-my-launcher` as
command.
\ No newline at end of file
INTENTIONALLY LEFT BLANK
\ No newline at end of file
version: '1.0'
configurations: {}
\ No newline at end of file
# LIST YOUR APT PACKAGES HERE
# LIST YOUR DUCKIETOWN PYTHON3 PACKAGES HERE
# NOTE: only place Duckietown libraries here; these libraries will be resolved to the latest available version and pinned; pin a specific version only if necessary
# LIST YOUR PYTHON3 PACKAGES HERE
# NOTE: only place non-Duckietown libraries here; pin versions only if necessary
docs_config_version: v1
# CONFIGURE THESE TO MATCH YOUR PROJECT:
project: "REPOSITORY_NAME_HERE"
copyright: "Duckietown"
author: "YOUR_NAME_HERE"
version: "ente"
custom_sections: [
"Configuration",
"Subscribers",
"Subscriber",
"Publishers",
"Publisher",
"Services",
"Service",
"Fields",
"Attribute",
"Attributes",
"inputs",
"input",
"outputs",
"output"
]
# REFRAIN FROM CHANGING THESE SPHINX-SPECIFIC CONFIGURATION SETTINGS:
autodoc_default_flags:
members: True
member-order: alphabetical
undoc-members: True
inherited-members: True
show-inheritance: True
add_module_names: False
# settings for napoleon
napoleon_google_docstring: True
napoleon_numpy_docstring: False
napoleon_include_init_with_doc: False
napoleon_include_private_with_doc: False
napoleon_include_special_with_doc: False
napoleon_use_admonition_for_examples: True
napoleon_use_admonition_for_notes: True
napoleon_use_admonition_for_references: True
napoleon_use_ivar: False
napoleon_use_param: False
napoleon_use_rtype: True
napoleon_use_keyword: True
# options for the sphinx_rtd_theme
html_theme_options:
prev_next_buttons_location: 'bottom'
style_nav_header_background: '#fbc10b'
collapse_navigation: False
sticky_navigation: True
navigation_depth: 4
includehidden: False
titles_only: False
.. documentation master file, created by
sphinx-quickstart on Fri Jul 19 20:26:50 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to REPOSITORY_NAME_HERE documentation!
==============================================
.. toctree::
:maxdepth: 1
:caption: Contents:
packages
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Duckietown Module: REPOSITORY_NAME_HERE
=======================================
.. toctree::
:glob:
:maxdepth: 4
packages/*
INTENTIONALLY LEFT BLANK
\ No newline at end of file
Python Package: example
=======================
.. contents::
TODO: This is a placeholder description of the Python Package.
INTENTIONALLY LEFT BLANK
\ No newline at end of file
#!/bin/bash
source /environment.sh
# initialize launch file
dt-launchfile-init
# YOUR CODE BELOW THIS LINE
# ----------------------------------------------------------------------------
# NOTE: Use the variable DT_REPO_PATH to know the absolute path to your code
# NOTE: Use `dt-exec COMMAND` to run the main process (blocking process)
# launching app
dt-exec echo "This is an empty launch script. Update it to launch your application."
# ----------------------------------------------------------------------------
# YOUR CODE ABOVE THIS LINE
# wait for app to end
dt-launchfile-join
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment