Giter Site home page Giter Site logo

Comments (10)

crazy-max avatar crazy-max commented on May 18, 2024

Hi @acehege, can you post your compose files ?

from swarm-cronjob.

acehege avatar acehege commented on May 18, 2024

Hi @acehege, can you post your compose files ?

Sure...

non-crontab service

version: '3.6'
services:
    runner:
        build:
            context: .
        image: $DOCKER_REGISTRY_REPO:$DOCKER_TAG
        environment:
            - RUNNER_TAG_LIST
            - RUNNER_EXECUTOR=${RUNNER_EXECUTOR-shell}
            - REGISTER_RUN_UNTAGGED=${REGISTER_RUN_UNTAGGED-false}
            - DOCKER_IMAGE
        command: run
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - /opt/gitlab_runner_builds:/opt/gitlab_runner_builds
        deploy:
            replicas: 1
            update_config:
                order: start-first
            placement:
                constraints:
                    - node.role == manager

No extra labels are added to the service other then the default ones:

                "com.docker.stack.image": "XXX/infrastructure/gitlab-runner-with-docker:fa9c1fd",
                "com.docker.stack.namespace": "shared_runner",
                "com.docker.ucp.access.label": "/",
                "com.docker.ucp.collection": "swarm",
                "com.docker.ucp.collection.root": "true",
                "com.docker.ucp.collection.swarm": "true"

crontab enabled service

version: '3.7'

x-cron-labels:
  &default-cron-labels
  swarm.cronjob.enable: "true"
  swarm.cronjob.schedule: "${SERVICE_CRONTAB_SCHEDULE:?err}"
  swarm.cronjob.skip-running: "false"

services:
  app:
    healthcheck:
      test: ["NONE"]
    labels:
      << : *default-cron-labels
    deploy:
      labels:
        << : *default-cron-labels
      restart_policy:
        condition: none

from swarm-cronjob.

crazy-max avatar crazy-max commented on May 18, 2024

Can you set LOG_LEVEL=debug env var to swarm-cronjob service and give me the logs ouput ?

from swarm-cronjob.

acehege avatar acehege commented on May 18, 2024

Can you set LOG_LEVEL=debug env var to swarm-cronjob service and give me the logs ouput ?

I am going to let it run overnight and post the logs tomorrow :)

from swarm-cronjob.

crazy-max avatar crazy-max commented on May 18, 2024

@acehege Ok thanks!

from swarm-cronjob.

acehege avatar acehege commented on May 18, 2024

It seems that updating a service ( or removing it ), tricks swarm-cronjob so it adds it to the cronlist... And ultimately crashes swarm-cronjob:

Mon, 14 Jan 2019 11:25:10 CET INF Add cronjob for service XXX with schedule 
Mon, 14 Jan 2019 11:25:10 CET ERR Cannot update job for service XXX error="Empty spec string"
Mon, 14 Jan 2019 12:34:54 CET DBG Event triggered for XXX (newstate='completed' oldstate='updating')
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/crazy-max/swarm-cronjob/app.Service(0xc0000e9d00, 0xc00016c010, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/app/app/swarm.go:60 +0x27d
github.com/crazy-max/swarm-cronjob/cmd.cronRun(0xb96600, 0xbb93b0, 0x0, 0x0)
	/app/cmd/root.go:84 +0xaa3
github.com/spf13/cobra.(*Command).execute(0xb96600, 0xc00001c1b0, 0x0, 0x0, 0xb96600, 0xc00001c1b0)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2cc
github.com/spf13/cobra.(*Command).ExecuteC(0xb96600, 0xc0000aad80, 0xc0001b1f68, 0x7815fe)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0xb96600, 0x0, 0xc0000aae68)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:800 +0x2b
github.com/crazy-max/swarm-cronjob/cmd.Execute()
	/app/cmd/root.go:24 +0x31
main.main()
	/app/main.go:8 +0x20

from swarm-cronjob.

crazy-max avatar crazy-max commented on May 18, 2024

Okay, I was able to reproduce your issue. I keep you in touch for a fix.

from swarm-cronjob.

crazy-max avatar crazy-max commented on May 18, 2024

@acehege Can you test the latest release (0.1.2) ?

from swarm-cronjob.

acehege avatar acehege commented on May 18, 2024

@acehege Can you test the latest release (0.1.2) ?

Looks like the latest release fixed the issue 👍

from swarm-cronjob.

crazy-max avatar crazy-max commented on May 18, 2024

Thanks 🙂
Keep me in touch if you encounter any other problems

from swarm-cronjob.

Related Issues (20)

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.