Skip to content

Replace Shell Scripts with Python Scripts#92

Merged
MarkKoz merged 9 commits into
masterfrom
feat/env/73/py-scripts
Feb 5, 2021
Merged

Replace Shell Scripts with Python Scripts#92
MarkKoz merged 9 commits into
masterfrom
feat/env/73/py-scripts

Conversation

@MarkKoz
Copy link
Copy Markdown
Contributor

@MarkKoz MarkKoz commented Feb 4, 2021

Closes #73

dev.sh has been replaced by Docker Compose. This means Docker Compose will create a container with development dependencies and the host bind mount. See d274d25 for justification.

protoc.sh is now protoc.py and has the following CLI:

CLI
usage: protoc.py [-h] version

Compile an NsJail config protobuf into Python.

positional arguments:
  version     the NsJail version from which to get the protobuf file

optional arguments:
  -h, --help  show this help message and exit

Other changes:

  • Updated some documentation, including splitting off developer documentation into a separate file
  • Tidied up the Pipfile scripts

@MarkKoz MarkKoz added type: feature New feature or request area: dev env Related to the development environment and its setup labels Feb 4, 2021
@MarkKoz MarkKoz force-pushed the feat/env/73/py-scripts branch from 691c5b4 to ce767d9 Compare February 4, 2021 03:08
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 4, 2021

Coverage Status

Coverage remained the same at 59.322% when pulling 21673ce on feat/env/73/py-scripts into c580809 on master.

@MarkKoz MarkKoz force-pushed the feat/env/73/py-scripts branch from b9b8fa3 to 8ee2b5c Compare February 4, 2021 19:22
The information is only relevant to developers. The README is what all
users will read; they shouldn't be subject to information that isn't
necessarily relevant to them.
Managing development containers through Docker Compose is convenient.
However, it isn't quite flexible enough to facilitate both development
and normal use. It's not really worth accommodating the latter since
the container gets pushed to a registry and that's the intended way to
run the service. Anyone that is checking out the repository and
therefore has access to the compose file is likely a developer, not a
user.
The new name better conveys what the script does.
@MarkKoz MarkKoz force-pushed the feat/env/73/py-scripts branch 3 times, most recently from 27cb4ae to 9785149 Compare February 5, 2021 00:31
Avoid redundant specification of Docker settings.

The compose file is set up to build all stages. This makes sense for
local development; both an interactive shell and running the webserver
are useful. Therefore, the image built is tagged "snekbox:dev".

However, CI does not need to run a webserver. It is therefore sufficient
for it to only build to the venv stage, and it does exactly that. The
image in CI is tagged as "snekbox-venv:<git sha>".

To facilitate the discrepancy in image tags, the suffix for the image
tag can be set with the new IMAGE_SUFFIX environment variable. Docker
Compose will use this to determine the image from which to create a
container.

A TTY needs to be allocated to prevent the container from exiting
immediately after starting. This is probably because the entrypoint
is Python (inherited from the base image), and the REPL relies on a TTY.
@MarkKoz MarkKoz force-pushed the feat/env/73/py-scripts branch from 9785149 to 21673ce Compare February 5, 2021 01:09
@MarkKoz MarkKoz added the area: CI Related to continuous intergration and deployment label Feb 5, 2021
@MarkKoz MarkKoz merged commit cf87b9b into master Feb 5, 2021
@MarkKoz MarkKoz deleted the feat/env/73/py-scripts branch February 5, 2021 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: CI Related to continuous intergration and deployment area: dev env Related to the development environment and its setup type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite dev/CI shell scripts in Python

2 participants