GithubHelp home page GithubHelp logo

drone / autoscaler Goto Github PK

View Code? Open in Web Editor NEW
191.0 191.0 87.0 728 KB

Automatically adds or removes instances based on build volume

Home Page: https://autoscale.drone.io

License: Other

Go 97.36% Shell 0.06% Dockerfile 0.09% CSS 2.49%

autoscaler's People

Contributors

ademariag avatar booya avatar bradrydzewski avatar colin-campbell avatar donny-dont avatar eoinmcafee00 avatar fhp avatar frebib avatar guessi avatar jlesage avatar jones2026 avatar julienduchesne avatar kolaente avatar logikone avatar msaizar avatar nsigarora avatar pajk avatar patrickjahns avatar philippgille avatar rocketbitz avatar smjt-h avatar sofixa avatar swjclarke avatar tboerger avatar techknowlogick avatar thejokersthief avatar tonglil avatar ttousai avatar vdemeester avatar zuchka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autoscaler's Issues

release notes for 1.8.0

needed to tag a quick release for a bug fix, without delay. the release notes are in progress (we merged a ton of pull requests) and are coming soon. thank you for your patience!

Creating a new instance on Hetznercloud fails with "image not found"

Since today, the autoscaler is unable to provision new instances on hetzner cloud. The drone cli tells me the ubuntu 16.04 image could not be found:

$ drone server info $(drone server ls)
Name: agent-wawR6snj
Address: 
Region:  
Size:    
State:   error
Error:   image 'ubuntu-16.04' not found (invalid_input)

My guess is hetzner deprecated the ubuntu 16.04 image.

I was able to fix this by setting the DRONE_HETZNERCLOUD_IMAGE environment variable to ubuntu-20.04 - I think the default should be set to 20.04. I could send a PR if you'd accept one.

How to specify Hetzner Cloud ssh key

Documentation says that DRONE_HETZNERCLOUD_SSHKEY must be an integer. How does such integer represent an SSH key?
I already added the public key to Hetzner, but how do I provide the private key to the autoscaler and how does an SSH key relate to a simple integer?

(Hetzner) Sometimes the server is not destroyed

Once in a while the created instance on Hetzner does not get destroyed. This results in a big bill from Hetzner because the server is still running.

Can it be that the autoscaler forgets that some servers exist when the autoscaler gets restarted, or the git server gets restarted?

This is our config:

drone-autoscaler:
    image: drone/autoscaler:1.8.2
    restart: unless-stopped
    volumes:
      - drone_autoscaler_data:/data
    environment:
      - DRONE_POOL_MIN=0
      - DRONE_POOL_MAX=4
      - DRONE_POOL_MIN_AGE=1h
      - DRONE_CAPACITY_BUFFER=0
      - DRONE_AGENT_CONCURRENCY=5
      - DRONE_SERVER_PROTO=https
      - DRONE_SERVER_HOST=REDACTED
      - DRONE_SERVER_TOKEN=${DRONE_SERVER_TOKEN}
      - DRONE_AGENT_TOKEN=${DRONE_RPC_SECRET}
      - DRONE_HETZNERCLOUD_DATACENTER=${DRONE_HETZNERCLOUD_DATACENTER}
      - DRONE_HETZNERCLOUD_IMAGE=ubuntu-20.04
      - DRONE_HETZNERCLOUD_TYPE=cx51
      - DRONE_HETZNERCLOUD_SSHKEY=${DRONE_HETZNERCLOUD_SSHKEY}
      - DRONE_HETZNERCLOUD_TOKEN=${DRONE_HETZNERCLOUD_TOKEN}
      - DRONE_INTERVAL=10s
      - DRONE_LOGS_DEBUG=false

clone: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Running an autoscaler to test arm64 builds.
AWS EC2 m6g.large
Sporadically seeing failed builds on newly launched instances:

clone: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

latest: Pulling from drone/git
Digest: sha256:091ecd02ee4ac5154fd76133c5055b2345a61cbc17182b00612df1fa7eef1510
Status: Downloaded newer image for drone/git:latest

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

However, inot consistently, maybe 10% of the time. Most of the time, no errors.

What comes to mind is to put a "sleep 1" or "systemctl restart docker" someplace. A very small change.

It looks like that is already present "[ systemctl, restart, docker ]"

Now trying a modification in drivers/internal/userdata/userdata.go . Change

  - path: /etc/docker/daemon.json
    content: |
      {
        "hosts": [ "0.0.0.0:2376", "unix:///var/run/docker.sock" ],
        "tls": true,
        "tlsverify": true,
        "tlscacert": "/etc/docker/ca.pem",
        "tlscert": "/etc/docker/server-cert.pem",
        "tlskey": "/etc/docker/server-key.pem"
      }

to

  - path: /etc/docker/daemon.json
    content: |
      {
        "hosts": [ "0.0.0.0:2376", "unix:///var/run/docker.sock" ],
        "containerd": "/run/containerd/containerd.sock",
        "tls": true,
        "tlsverify": true,
        "tlscacert": "/etc/docker/ca.pem",
        "tlscert": "/etc/docker/server-cert.pem",
        "tlskey": "/etc/docker/server-key.pem"
      }

Adding "containerd": "/run/containerd/containerd.sock" , based on this article https://stackoverflow.com/questions/68823645/what-is-purpose-of-the-switch-containerd-in-command-dockerd

I'll report back, if it eventually improves the condition.

Switch the default watchtower image

I would suggest to update the default for the used Watchtower image as DockerHub will switch the payment policy and I won't way the huge amount which will lead to the removal of the Webhippie organization on DockerHub. If you want to continue using this Watchtower image you should switch to ghcr.io/dockhippie/watchtower or quay.io/webhippie/watchtower.

Add DRONE_AGENT_PUBLISHED_PORTS to Documenation

Spent the last few hours grappling with my agent docker containers deployed via autoscaler not having port 3000 exposed. As a result, drone could push jobs to the agent. I dove the source code and found the ENV var mentioned in the subject. It would have saved a lot of time if this was documented at autoscale.drone.io. Not sure how to go about contributing, figured it was worth a mention.

Furthermore, why does this var not have a default of 3000:3000 in the code? is this by design? or an overlooked issue? figure I may be doing something wrong and would like confirmation before opening a PR to make that change.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.