Skip to content

Releases: edwardUL99/DockerSandbox

Created new stable release with a new API

16 May 14:00
167d3eb
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.4.1...1.0.0

New API

The new API provides the previously static DockerSandbox class as an interface which allows multiple sandbox instantiations to be created independently. A builder can be used to build and configure an instance. The new API allows for a cleaner and simpler to use interface.

Fixed SLF4J Warning message

19 Jun 19:07
Compare
Choose a tag to compare

On startup of a Java program using this library, sometimes an SLF4J logger warning would appear saying there are double bindings on the classpath. This release removes that warning message

Added execution duration to Result

17 Jun 20:27
e4a2899
Compare
Choose a tag to compare

The execution duration of the docker container has now been added to the Result class. If it could not be determined, Double.NaN is used.

Removed working directory from Profiles

17 Jun 20:16
c697b02
Compare
Choose a tag to compare

In earlier versions, working directory was present in a profile. But, a working directory was also passed into Docker#open which was used to create the WorkingDirectory object. However, this working directory path was ignored as the profile's working directory would be used. This led to unexpected behavior. The following changes has occurred in this release:

  • Working directory has been removed from profiles and is instead retrieved from the call to Docker#open
  • From this release, this library is published on Maven Central with the coordinates:
<groupId>io.github.edwardUL99</groupId>
<artifactId>docker-sandbox</artifactId>
<version>{VERSION_CODE}</version>
  • Mountpoint has been removed from the WorkingDirectory class as the mount point does not need to be known

Added execution timeout

15 Jun 09:07
2b55ff3
Compare
Choose a tag to compare

Execution timeout (in seconds) has been added. It is configured on a profile-by-profile basis. If execution exceeds the specified timeout, the container will return and a Result object with isTimedOut() true will be returned. This ensures there are no infinite loops that will indefinitely keep the container running and block the calling thread.

Initial Release

14 Jun 18:30
Compare
Choose a tag to compare

This is the initial release of the library. To see what the library provides, see the README.md file in this release. It is an experimental release as it is a library that I have completed in my free time.

I produced this library with inspiration from StepicOrg/epicbox for Python. I wanted to experiment with how to produce a similar library for use in Java and I have come up with a lightweight version (lightweight as it doesn't support as many features (especially with limits) as epicbox does).

Known Issues:

  • If stdin is provided to a DockerSandbox.run call but the command provides doesn't use stdin, the calling thread gets blocked.
  • The only limits available are CPU count and Memory. There is no timeout feature yet
  • If the command continuously reads from stdin without terminating until a Ctrl-D character is received, the thread will also be blocked as the container won't terminate until that Ctrl-D is hit (relates to the timeout issue). The command cat without any arguments or - is a common one where this issue may occur, so if this command is received, a Ctrl-D character is added to the end of the stdin input