Verified Commit ca49d336 authored by Snorre Magnus Davøen's avatar Snorre Magnus Davøen 💬
Browse files

Release initial version of containinator



Adds Docker image to more easily run command. Expand on usage and development in
README. Add release to CHANGELOG.
Signed-off-by: Snorre Magnus Davøen's avatarSnorre Magnus Davøen <snorre.davoen@nsd.no>
parent cebccd27
*
!containinator
!libsunec.so
\ No newline at end of file
......@@ -12,4 +12,5 @@ pom.xml.asc
.hgignore
.hg/
containinator
.token
\ No newline at end of file
.token
libsunec.so
\ No newline at end of file
......@@ -2,9 +2,12 @@
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
## [Unreleased]
## [v0.1.0] - 2019-06-26
### Added
- Initial implementation of command line app
- locate argument to list projects with container registry
- terminate argument to instruct GitLab to bulk delete Docker image tags from projects' registries
- Docker image to bundle all required dependencies (dynamically linked libsunec and others)
[Unreleased]: https://gitlab.nsd.no/ops/containinator/compare/master...master
[Unreleased]: https://gitlab.nsd.no/ops/containinator/compare/v0.1.0...master
FROM adoptopenjdk/openjdk12:slim
WORKDIR /app
COPY ./containinator /app/
ENTRYPOINT [ "/app/containinator", "-Djava.library.path=/opt/java/openjdk/lib/" ]
\ No newline at end of file
......@@ -10,16 +10,29 @@ For this reason you should probably use `docker-distribution-pruner` after runni
## Installation
TBD
You can run the command via the Docker image:
```bash
docker run -it --rm docker.nsd.no/ops/containinator:latest --help
```
You can also build the app binary yourself.
Refer to the development section for detailed instructions.
```bash
clj -Anative-image
# You need to tell the command where to find java libs so it can get the libsunec.so file
./containinator -Djava.library.path=/path/to/java/lib/ --help
```
### Caveat
Currently binaries compiled with GraalVM's native-image does not hardlink the `sunec` dependency.
Currently binaries compiled with GraalVM's native-image does not statically link the `sunec` dependency.
If you are running the binary on its own you need to supply the sunec library via an openjdk or graalvm installation.
There is [an issue](https://github.com/oracle/graal/issues/1336) about this in the official graal repository.
For the time being you can run the binary with `containinator -Djava.library.path=/<path to java/graal>/lib/`.
The Docker image will bundle the sunec dependency.
The Docker image is based on the `adoptopenjdk/openjdk12` image and thus bundles the libsunec.so file.
## Usage
......@@ -53,11 +66,38 @@ Locating projects for given arguments on https://gitlab.nsd.no Please be patient
## Development
...
Ensure you have the following installed:
- [openjdk](https://adoptopenjdk.net/)
- [Clojure](https://clojure.org/guides/getting_started)
- [GraalVM](https://github.com/oracle/graal/releases)
To run a repl:
```bash
clj
```
Use your editor's jack-in functionality when developing with an editor like Emacs, VSCode Calva, or IntelliJ Cursive.
To comple a binary:
```bash
clj -Anative-image
```
To build a Docker image:
Ensure that the `libsunec.so` command is present in the project root.
You can copy it from your GraalVM installation.
```bash
docker build -t docker.nsd.no/ops/containinator:latest .
```
## Testing
...
Testing is not really applicable as more or less the entire app is side-effecting.
## License
......
......@@ -2,18 +2,15 @@
:deps {org.clojure/clojure {:mvn/version "1.9.0"}
cli-matic {:mvn/version "0.3.7"}
org.martinklepsch/clj-http-lite {:mvn/version "0.4.1"}
clj-http {:mvn/version "3.10.0"}
metosin/muuntaja {:mvn/version "0.6.4"}}
:aliases
{:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "RELEASE"}}}
:native-image
{:native-image
{:main-opts ["-m clj.native-image containinator"
"--enable-url-protocols=http,https"
"--report-unsupported-elements-at-runtime"
"--initialize-at-build-time"
#_"--static"
"--no-fallback"
"-H:Name=containinator"]
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
......@@ -22,11 +19,5 @@
{:git/url "https://github.com/taylorwood/clj.native-image.git"
:sha "567176ddb0f7507c8b0969e0a10f60f848afaf7d"}}}
:runner
{:extra-deps {com.cognitect/test-runner
{:git/url "https://github.com/cognitect-labs/test-runner"
:sha "76568540e7f40268ad2b646110f237a60295fa3c"}}
:main-opts ["-m" "cognitect.test-runner"
"-d" "test"]}
:uberjar {:extra-deps {seancorfield/depstar {:mvn/version "RELEASE"}}
:main-opts ["-m" "hf.depstar.uberjar" "containinator.jar"]}}}
......@@ -182,7 +182,7 @@
(def app-config
{:app {:command "containinator"
:description "A command to locate and terminate Docker image tags on GitLab servers"
:version "0.1"}
:version "0.1.0"}
:global-opts [{:option "token"
:short "t"
:env "CONTAININATOR_TOKEN"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment