SquirrelCorporation / SquirrelServersManager

A user friendly, UI/UX focus server & configuration management tool
https://squirrelserversmanager.io/
GNU Affero General Public License v3.0
747 stars 22 forks source link

[FEATURE] Agent in docker #298

Closed Buco7854 closed 1 week ago

Buco7854 commented 1 month ago

Would it be possible to actually dockerize the agent? I'm having issues with the agents (nvm path not found etc...) and I thought putting the agent in a container would solve this kind of issue.

Would also be cleaner than installing things directly on the agent's host and would make sure that the uninstall process would be "total".

SquirrelDeveloper commented 1 month ago

Hi @Buco7854 . You are right, as I am not satisfied with the way the agent works today. Dockerizing it could be a challenge to access fully the underlying system, but it will definitely change in the near future. Keeping the issue opened to allow discussion

Buco7854 commented 1 month ago

Can't really talk for sure but isn't it possible to access host system info py mounting /proc for example?

SquirrelDeveloper commented 1 month ago

You are probably right, I will have to take a good look at the libs the agent is using ("system information" among other things )

Buco7854 commented 1 month ago

I run netdata in a docker container and they mount the whole file system in /host. So it's probably possible since they do it.

But yes, I don't know exactly how and I cannot really look right now.

SquirrelDeveloper commented 1 month ago

Hi @Buco7854 ; I have published an experimental docker version of the agent, https://github.com/SquirrelCorporation/SquirrelServersManager-Agent

Buco7854 commented 1 month ago

Thanks a lot, will probably fix my issue, any ETA on production?

SquirrelDeveloper commented 1 month ago

@Buco7854 The plan is to offer the choice in the UI of the agent method installation. Due to docker limitation, the dockerized agent will only be available on Linux platforms (not Macos) so I guess the differents agent install methods will live together for a long time. If you have time, give it a try (from a scratch install)

chrisbehectik commented 1 month ago

I couldn't get the agent working with the .env file, kept saying URL_MASTER was missing so I passed them directly in the compose file. Also, it seems that the variable is API_URL_MASTER. Example below for anyone else with the same issue:

  agent-ssm:
    container_name: agent-ssm
    image: ghcr.io/squirrelcorporation/squirrelserversmanager-agent:docker
    network_mode: host
    privileged: true
    pid: host
    environment:
      API_URL_MASTER: "https://ssm.domain.com"
      OVERRIDE_IP_DETECTION: "TAILSCALE-IP"
    restart: unless-stopped
    volumes:
      - /proc:/proc
      - /var/run/docker.sock:/var/run/docker.sock
      - ./agent-ssm/data:/data/
SquirrelDeveloper commented 1 month ago

You're right, it's a mistake on my part, I have fixed it