mikejmoore / docker-swarm-sdk Goto Github PK
View Code? Open in Web Editor NEWRuby SDK for Docker Swarm
License: MIT License
Ruby SDK for Docker Swarm
License: MIT License
This method should allow the created overlay network to, optionally, be attachable.
Docker::Swarm::Swarm.create_network_overlay crashes with Socket EOF exception when one (or more) of the nodes is down. When attempting to retrieve node.networks from a node that's currently down it returns a Socket EOF
In docker-api I could do:
Docker::Event.stream { |event| puts event }
It would be great to have the same functionality but with Swarm Events.
Thanks in advance!
Hello,
Is this repository/code not maintained anymore?
I noticed that quite a few issues or PRs are unanswered since a few years...
Thanks for your answer in advance.
Right now the tasks instance method (http://www.rubydoc.info/gems/docker-swarm-api/Docker/Swarm/Swarm#tasks-instance_method) of the Swarm class does not take any parameters and as such returns every tasks in a swarm.
It would be a good idea to add a parameter to the tasks method in order to filter by any valid filter criteria (e.g. service=<service name>
) as defined in the Docker API here: https://docs.docker.com/engine/api/v1.27/#tag/Task
Using the following code:
swarm.nodes.each do |node|
p node.networks
end
It will fail with the following error:
RuntimeError at ... No connection set for node: ...
lib/docker/swarm/node.rb in networks
148. raise "No connection set for node: #{self.host_name}, ID: #{self.id}"
% bundle exec rspec
Sorry, you can't use byebug without Readline. To solve this, you need to
rebuild Ruby with Readline support. If using Ubuntu, try `sudo apt-get
install libreadline-dev` and then reinstall your Ruby.
Readline is installed.
The README.md speaks of create_overlay_network
, perhaps swarm. create_network_overlay
was meant, instead.
def self.init(opts, connection)
...
swarm = Docker::Swarm::Swarm.swarm(opts, connection)
...
end
def self.swarm(connection, options = {})
...
% bundle exec rake -T
rake aborted!
LoadError: cannot load such file -- cane/rake_task
Hi,
I discovered after after some fight with the docker api, that in order to actually force the update of a service, the ForceUpdate
flag must actually change, not only be set to 1
.
They describe it as a counter, not as a flag. So the current implementation of restart can only be used once, after that the ForceUpdate
counter in the service spec (as reported by docker service inspect
will be set to 1
and the restart won't work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.