amihaiemil / docker-java-api

Lightweight Java Docker client
BSD 3-Clause "New" or "Revised" License
270 stars 53 forks source link

Added version API #316

Closed milux closed 4 years ago

milux commented 4 years ago

This PR adds support for the version API documented at https://docs.docker.com/engine/api/v1.35/#operation/SystemVersion. RtVersion doesn't have any methods, since there are no ops available with this API. Convenience methods for the available JSON properties might be implemented if desired.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 581


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/com/amihaiemil/docker/RtVersion.java 13 14 92.86%
<!-- Total: 16 17 94.12% -->
Totals Coverage Status
Change from base Build 575: 0.06%
Covered Lines: 871
Relevant Lines: 961

💛 - Coveralls
0crat commented 4 years ago

This pull request #316 is assigned to @amihaiemil/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @amihaiemil/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be a monetary reward for this job

0crat commented 4 years ago

Manual assignment of issues is discouraged, see §19: -5 point(s) just awarded to @amihaiemil/z

milux commented 4 years ago

BTW: Please let me be quite clear that I don't want to earn money with this. Also didn't know about your article, but thanks for the information. :smile: This is an improvement for my institute because we need this API in a project, and I chose your library because its lightweight dependency tree. :wink:

amihaiemil commented 4 years ago

@milux Thank you. I would still like to send you some cash in PayPal, if you give me your e-mail address from there.

I want to invest in my projects, attract developers, build a distributed team etc.

Also, maybe your institute could invest a few dollars in this library, so we make it better with Bounties.

milux commented 4 years ago

Done, both. Regarding docker(): Not possible anymore, because I removed the property. :wink: Also can't think about a use case where this is actually useful, but if you insist, I will add it back...

amihaiemil commented 4 years ago

@milux well, all the objects in the library have the docker() method. It's very useful. Say you pass this Version object to a method in your software, and inside that method you want to access Docker. You just say version.docker() -- this method call would translate to "Get me the Docker with this version".

But we can add it later, no worries.

Can you fix the build, then we'll merge the PR? :D

milux commented 4 years ago

@milux Thank you. I would still like to send you some cash in PayPal, if you give me your e-mail address from there.

I want to invest in my projects, attract developers, build a distributed team etc.

Sure, very good and noble attitude and plans, but I'm afraid taking money could violate a bunch of regulations, for instance our anti-corruption rules (Yes it's silly, but that's Germany... ^^).

Also, maybe your institute could invest a few dollars in this library, so we make it better with Bounties.

I wish, but I believe the sad reality is that while we can pay for commercial tools, supporting FOSS projects bounces because all those stupid regulations. :disappointed:

amihaiemil commented 4 years ago

@milux Well, I don't think it's corruption to take money for honest work :D

If you change your mind, let me know. I saw you understood the architecture here so we could use contributors.

amihaiemil commented 4 years ago

@rultor try to merge

amihaiemil commented 4 years ago

@rultor try to merge

rultor commented 4 years ago

@rultor try to merge

@amihaiemil OK, I'll try to merge now. You can check the progress of the merge here

rultor commented 4 years ago

@rultor try to merge

@amihaiemil @milux Oops, I failed. You can see the full log here (spent 6min)

WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
+ set -e
+ set -o pipefail
+ shopt -s dotglob
+ useradd -m -G sudo r
+ echo '%sudo ALL=(ALL) NOPASSWD:ALL'
+ cp -R /root/.bashrc /root/.composer /root/.gem /root/.gnupg /root/.m2 /root/.oracle_jre_usage /root/.profile /root/texmf /home/r
+ cp -R ./cid ./end.sh ./entry.sh ./pid ./pubring.gpg ./repo ./run.sh ./script.sh ./secring.gpg ./settings.xml ./stdout /home/r
+ rm -rf repo
+ chown -R r:r /home/r
+ chmod a+x /home/r/script.sh
+ su --login r --command /home/r/script.sh
mesg: /dev/pts/0: Operation not permitted
+ set -e
+ set -o pipefail
+ shopt -s expand_aliases
+ alias 'sudo=sudo -i'
+ export HOME=/home/r
+ HOME=/home/r
+ cd /home/r/repo
+ export 'MAVEN_OPTS=-XX:MaxPermSize=256m -Xmx1g'
+ MAVEN_OPTS='-XX:MaxPermSize=256m -Xmx1g'
+ export head=git@github.com:amihaiemil/docker-java-api.git
+ head=git@github.com:amihaiemil/docker-java-api.git
+ export pull_id=316
+ pull_id=316
+ export fork=git@github.com:milux/docker-java-api.git
+ fork=git@github.com:milux/docker-java-api.git
+ export fork_branch=version-api
+ fork_branch=version-api
+ export head_branch=master
+ head_branch=master
+ export 'pull_title=Added version API'
+ pull_title='Added version API'
+ export author=amihaiemil
+ author=amihaiemil
+ mvn clean install -Pcheckstyle
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Docker Java API 0.0.11-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/jacoco/jacoco-maven-plugin/0.7.6.201602180812/jacoco-maven-plugin-0.7.6.201602180812.pom

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.695 s
[INFO] Finished at: 2020-02-19T15:54:49+00:00
[INFO] Final Memory: 9M/457M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.jacoco:jacoco-maven-plugin:0.7.6.201602180812 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.jacoco:jacoco-maven-plugin:jar:0.7.6.201602180812: Could not transfer artifact org.jacoco:jacoco-maven-plugin:pom:0.7.6.201602180812 from/to Maven (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/jacoco/jacoco-maven-plugin/0.7.6.201602180812/jacoco-maven-plugin-0.7.6.201602180812.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
container 482ec32d8e0e24d25f253af32ed7399e5a3aee4ef07e0df304b4afaed821050d is dead
Wed Feb 19 16:56:11 CET 2020
rultor commented 4 years ago

@rultor try to merge

@amihaiemil OK, I'll try to merge now. You can check the progress of the merge here

milux commented 4 years ago

@amihaiemil I noticed that there was a copy-paste flaw in the comment of the unit test I provided. It appears that the commit didn't make it to this PR. If rultor fails again, you may want to include this, although it's a minor thing.

rultor commented 4 years ago

@rultor try to merge

@amihaiemil @milux Oops, I failed. You can see the full log here (spent 6min)

WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
+ set -e
+ set -o pipefail
+ shopt -s dotglob
+ useradd -m -G sudo r
+ echo '%sudo ALL=(ALL) NOPASSWD:ALL'
+ cp -R /root/.bashrc /root/.composer /root/.gem /root/.gnupg /root/.m2 /root/.oracle_jre_usage /root/.profile /root/texmf /home/r
+ cp -R ./cid ./end.sh ./entry.sh ./pid ./pubring.gpg ./repo ./run.sh ./script.sh ./secring.gpg ./settings.xml ./stdout /home/r
+ rm -rf repo
+ chown -R r:r /home/r
+ chmod a+x /home/r/script.sh
+ su --login r --command /home/r/script.sh
mesg: /dev/pts/0: Operation not permitted
+ set -e
+ set -o pipefail
+ shopt -s expand_aliases
+ alias 'sudo=sudo -i'
+ export HOME=/home/r
+ HOME=/home/r
+ cd /home/r/repo
+ export 'MAVEN_OPTS=-XX:MaxPermSize=256m -Xmx1g'
+ MAVEN_OPTS='-XX:MaxPermSize=256m -Xmx1g'
+ export head=git@github.com:amihaiemil/docker-java-api.git
+ head=git@github.com:amihaiemil/docker-java-api.git
+ export pull_id=316
+ pull_id=316
+ export fork=git@github.com:milux/docker-java-api.git
+ fork=git@github.com:milux/docker-java-api.git
+ export fork_branch=version-api
+ fork_branch=version-api
+ export head_branch=master
+ head_branch=master
+ export 'pull_title=Added version API'
+ pull_title='Added version API'
+ export author=amihaiemil
+ author=amihaiemil
+ mvn clean install -Pcheckstyle
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Docker Java API 0.0.11-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/jacoco/jacoco-maven-plugin/0.7.6.201602180812/jacoco-maven-plugin-0.7.6.201602180812.pom

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.556 s
[INFO] Finished at: 2020-02-19T16:04:57+00:00
[INFO] Final Memory: 8M/362M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.jacoco:jacoco-maven-plugin:0.7.6.201602180812 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.jacoco:jacoco-maven-plugin:jar:0.7.6.201602180812: Could not transfer artifact org.jacoco:jacoco-maven-plugin:pom:0.7.6.201602180812 from/to Maven (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/jacoco/jacoco-maven-plugin/0.7.6.201602180812/jacoco-maven-plugin-0.7.6.201602180812.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
container d17f0155deb364a2edaa1ec8eb29087f64edc84af22f4e7d497176e1f3048345 is dead
Wed Feb 19 17:06:29 CET 2020
amihaiemil commented 4 years ago

@milux rultor has other issues, unfortunately.... it will be an Issue for us now because until Rultor is fixed, I cannot make a release to Maven Central...

0crat commented 4 years ago

Job was finished in 3 hours, bonus for fast delivery is possible (see §36)

0crat commented 4 years ago

Order was finished: +20 point(s) just awarded to @amihaiemil/z

0crat commented 4 years ago

Payment to ARC for a closed pull request, as in §28: +10 point(s) just awarded to @amihaiemil/z