Commit Graph

34 Commits

Author SHA1 Message Date
Alexis Couvreur
8b113a3c76 fix: changing module to github.com/sablierapp/sablier 2024-10-20 23:54:53 -04:00
Alexis Couvreur
2bb1ad46e8 fix(kubernetes): use ParseName everywhere with replicas 2024-10-01 17:30:14 -07:00
Alexis Couvreur
c6f0628411 perf(providers): retrieve state on start instead of assuming starting (#350)
When an instance does not exist yet and needs to be started, its status is not assumed to be starting anymore.

Instead, the statue will be retrieved from the provider. This changes one thing, it's that you may be able to start and access your services instantly because they'll be instantly seen as ready.

With this change, you might want to make sure that your containers have a proper healthcheck used to determine when the application is able to process incoming requests.

* refactor: add interface guards

* refactor(providers): remove instance.State as a return value from Stop and Start

* test(e2e): add healthcheck on nginx container

Because now the container check is so fast, we need to add a delay on which the container is considered started and healthy to have a proper waiting page.

* fix(tests): using acouvreur/whoami:v1.10.2 instead of containous/whoami:v1.5.0

This image simply retrieve the curl binary from curlimages/curl:8.8.0 to be able to add proper docker healthcheck commands.

Once this is merged with traefik/whoami, I'll update back to the original image.

See https://github.com/traefik/whoami/issues/33
2024-10-01 17:30:14 -07:00
Alexis Couvreur
dfb9bacf59 feat(providers): add provider.auto-stop-on-startup argument (#346)
This feature adds the capability to stop unregistered running instances upon startup.

Previously, you had to stop running instances manually or issue an initial request that will shut down instances afterwards.

With this change, all discovered instances will be shutdown. They need to be registered using labels. E.g.: sablier.enable=true

Fixes #153
2024-10-01 17:30:14 -07:00
Alexis Couvreur
7ddb6ae6e0 fix(docker): ensure connection is established with host
The `docker` and `docker_swarm` providers have been patched to ensure that the connection is properly established upon starting.

If the docker host is not available at starting time, then the application will stop. This will prevent from trying to register to the event stream on a non working client.
2024-10-01 17:30:14 -07:00
renovate[bot]
f40fe10d59 fix(deps): update module github.com/docker/docker to v26 2024-05-30 12:10:00 -04:00
Alexis Couvreur
a5a6e06cf4 fix(kubernetes): discovered deployments will be properly registered
closes #299
2024-05-04 23:05:03 -04:00
Alexis Couvreur
932d9c9c52 Merge branch 'main' into beta 2024-04-21 04:44:51 +00:00
Alexis Couvreur
0e6a13249c fix(providers): add docker_swarm as a provider
Currently the documentation states that `docker_swarm` is an acceptable value for the Docker Swarm provider.
However, the code actually uses `swarm`.

This changes adds `docker_swarm` as a supported provider alias for docker swarm.

Closes #279
2024-04-16 17:22:58 -04:00
Alexis Couvreur
60b270472d feat(kubernetes): add provider.kubernetes.delimiter config property
the delimiter configuration property for kubernetes allows you to change the default "_" delimiter.

By specifying "/" or "." as a delimiter you ensure that you won't collide with objects names that contains the default delimiter "_".

Fixes #207
2024-02-05 12:05:12 -05:00
Alexis Couvreur
1cbe5d6fbb fix(deps): update module github.com/docker/docker to v25 2024-02-05 05:17:13 +00:00
Massimeddu Cireddu
0a72b337c2 feat(kubernetes-provider): get groups from statefulsets 2024-02-05 04:50:30 +00:00
Alexander Vyssochin
f4e88ae322 fix(providers/kubernetes): Added QPS and Burst tweaks for client-side throttling 2023-10-10 13:30:23 -04:00
Alexis Couvreur
72ea3b3645 refactor(provider): pass context.Context down to all operations
This means that with more work, a canceled request would cancel to underlying request.
2023-09-15 01:03:41 +02:00
Alexis Couvreur
ea1030353e feat(deps): upgrade to go 1.21 2023-08-25 18:11:01 -04:00
Alexis Couvreur
fc1b133704 fix(kubernetes): use kind_namespace_name_replicas format for group scanning 2023-04-08 15:24:48 -04:00
Alexis Couvreur
795792058f feat: add filter by labels (#134)
You are now able to use labels on containers and services such as `--sablier.enable=true` and `--sablier.group=mygroup` to select groups.
2023-03-28 21:31:22 -04:00
Alexis Couvreur
b6d73a3587 tests: pass lock by reference instead of value
fixes vet like "app/providers/mocks/client_mock.go:314:9: Get passes lock by value: github.com/acouvreur/sablier/app/providers/mocks.DeploymentMock contains github.com/stretchr/testify/mock.Mock contains sync.Mutex"
2023-01-09 13:00:06 -05:00
Alexis Couvreur
fe954e4372 fix(kubernetes): add deletion event listener 2022-11-14 19:43:19 +00:00
Alexis Couvreur
a550f8a817 fix(swarm): listen for removed services 2022-11-14 19:35:59 +00:00
Alexis Couvreur
93e4fbb901 test(swarm): fix typo SeviceScaledEvent to ServiceScaledEvent 2022-11-14 19:35:59 +00:00
Alexis Couvreur
406a93b10e fix: typo NotifyInsanceStopped to NotifyInstanceStopped 2022-11-14 03:57:31 +00:00
Alexis Couvreur
b7e17dc77c fix(provider): use Actor.Attributes["name"] instead of deprecated From 2022-11-12 17:34:54 -05:00
Alexis Couvreur
d5da881604 feat: add kubernetes event listener
If a deployment or a statefulset is scaled to 0, then it is removed from the store.

In order for this to work, you need the `list` and `watch` verbs in your ClusterRole
2022-11-11 17:00:35 -05:00
Alexis Couvreur
006fb6679b refactor(events): close the channel from the sender 2022-11-11 17:00:35 -05:00
Alexis Couvreur
79d1f86ddf fix(swarm): remove suffix match on name
This could bring too much complexity. If a new service was created with exact match, it would take pecedence over the previously suffix matched service.

Closes #85
2022-11-08 15:57:38 -05:00
Alexis Couvreur
a62f098d42 feat: add swarm event listener 2022-11-07 17:12:13 -05:00
Alexis Couvreur
1ca1934b1c feat(docker): listens for container stopped event
When a container is shutdown manually while it's registered as `ready` in Sablier it will remove it from the store.
Meaning externally events are now handled for docker.
2022-11-06 00:24:10 -04:00
Alexis Couvreur
8096a4e87e feat: add DesiredReplicas inside State struct
For now only the `Kubernetes` provider benefits from this improvement as `Docker` and `Swarm` have hardcoded 1 value
2022-11-03 20:55:09 -04:00
Alexis Couvreur
c827154506 refactor: instance are in unrecoverable state instead of error
To avoid confusion between error from a call or network.
Instance has an Unrecoverable state instead of Error.
2022-11-02 23:15:06 -04:00
Alexis Couvreur
67bf03780c refactor: use common object for describing instances 2022-11-02 23:15:06 -04:00
Alexis Couvreur
a33c822334 feat(provider): add kubernetes provider 2022-11-02 23:15:06 -04:00
Alexis Couvreur
1b145522cf feat(provider): add docker swarm provider 2022-11-02 23:15:06 -04:00
Alexis Couvreur
bbdddca107 feat(provider): add docker provider 2022-11-02 23:15:06 -04:00