GithubHelp home page GithubHelp logo

artefactual-labs / docker-gearmand Goto Github PK

View Code? Open in Web Editor NEW
17.0 8.0 12.0 27 KB

Docker image of gearmand based on Alpine Linux.

Home Page: https://hub.docker.com/r/artefactual/gearmand/

License: Apache License 2.0

Shell 44.50% Dockerfile 55.50%
gearmand docker docker-image gearman backend containers queue jobs

docker-gearmand's Introduction

gearmand

Latest Release

artefactual/gearmand packages recent versions of gearmand using Alpine Linux as the base image.

Supported tags and respective Dockerfile links

See also the official releases page.

Supported gearmand backends

  • builtin (default)
  • libmemcached
  • mysql (using mariadb-dev)
  • redis

Usage

Print help:

docker run --rm -i artefactual/gearmand:latest --help

Use redis backend and set verbose level to DEBUG.

docker run --rm -i artefactual/gearmand:latest --queue-type=redis --redis-server=192.168.1.1 --redis-port=6379 --verbose=DEBUG

Environment variables

This image includes an entry point that translates environment strings into configuration attributes. The following is a list of the strings currently supported:

Name Description Default
VERBOSE Logging level INFO
GEARMAND_PORT Listen port 4730
QUEUE_TYPE Persistent queue type to use builtin
THREADS Number of I/O threads to use 4
BACKLOG Number of backlog connections for listen 32
FILE_DESCRIPTORS Number of file descriptors to allow for the process Default is max allowed for user
JOB_RETRIES Number of attempts to run the job before the job server removes it. Default is no limit. 0
ROUND_ROBIN Assign work in round-robin order per worker connection 0
WORKER_WAKEUP Number of workers to wakeup for each job received 0
KEEPALIVE Enable keepalive on sockets 0
KEEPALIVE_IDLE The duration between two keepalive transmissions in idle condition 30
KEEPALIVE_INTERVAL The duration between two successive keepalive retransmissions, if acknowledgement to the previous keepalive transmission is not received 10
KEEPALIVE_COUNT The number of retransmissions to be carried out before declaring that remote end is not available 5
MYSQL_HOST MySQL server host localhost
MYSQL_PORT MySQL server port 3306
MYSQL_USER MySQL server user root
MYSQL_PASSWORD MySQL password
MYSQL_PASSWORD_FILE Path to file with MySQL password (Docker secrets)
MYSQL_DB Database to use by Gearman Gearmand
MYSQL_TABLE Table to use by Gearman gearman_queue

You can also inject your version of config file to /etc/gearmand.conf as needed.

Credits

See the list of contributors.

Thanks to @Mararok for the new entry point bringing support for environment variables and secrets.

docker-gearmand's People

Contributors

brianlmoon avatar mararok avatar maxxer avatar sbreker avatar sevein avatar

Stargazers

 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

docker-gearmand's Issues

QUEUE_ERROR:QUEUE_ERROR -> libgearman/client.cc:1603

I got this error from my application and checking gearmand logs (on debug mode), I found this error:

mysql_stmt_execute failed: Unknown prepared statement handler (1)

Looks like if you use the mysql driver, is needed the uuid package (libuuid in alpine)

As I'm not sure if this repository is maintained any more, if you get this error, just create your own Dockerfile and add these thre lines:

USER root
RUN apk add libuuid
USER gearman

source: https://ma.ttias.be/gearman-queue-error-mysql_stmt_execute-failed-unknown-prepared-statement-handler-1/

Container is not starting in kubernetes

Hi while starting the container in kubernetes i am getting error .
INFO 2023-02-20 11:54:06.040737 [ main ] Initializing Gear on port tcp://100.112.19.203:4730 with SSL: false
INFO 2023-02-20 11:54:06.000000 [ main ] Starting up with pid 1, verbose is set to INFO
ERROR 2023-02-20 11:54:06.000000 [ main ] 0.0.0.0:tcp://100.112.19.203:4730 getaddrinfo(Unrecognized service) -> libgearman-server/gearmand.cc:626
INFO 2023-02-20 11:54:06.000000 [ main ] Shutdown complete
Please suggest what is the issue?

Native ARM64 support

I assume you have access to push multiple architecture builds for the same image. I was able to confirm that building on ARM64 works fine on my M1 Mac. I was wondering if was possible to push an ARM64 architecture tag so that this can run without emulation on ARM-based machines.

Using the Dockerfile from the 1.1.20 release:

/usr/local/bin $ cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.16.8
PRETTY_NAME="Alpine Linux v3.16"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
/usr/local/bin $ uname -a
Linux 5bb5a64f0e90 6.4.16-linuxkit #1 SMP PREEMPT Thu Nov 16 10:49:20 UTC 2023 aarch64 Linux
/usr/local/bin $ ./gearadmin  --status
.
/usr/local/bin $ ./gearadmin  --getpid
1
/usr/local/bin $ ./gearadmin  --show-unique-jobs
.
/usr/local/bin $ ps
PID   USER     TIME  COMMAND
    1 gearman   0:00 gearmand
   14 gearman   0:00 /bin/sh
   36 gearman   0:00 ps

Logs

2023-12-05 22:06:29    INFO 2023-12-06 03:06:29.448364 [  main ] Initializing Gear on port 4730 with SSL: false
2023-12-05 22:06:29    INFO 2023-12-06 03:06:29.000000 [  main ] Starting up with pid 1, verbose is set to INFO
2023-12-05 22:06:29    INFO 2023-12-06 03:06:29.000000 [  main ] Listening on 0.0.0.0:4730 (9)
2023-12-05 22:06:29    INFO 2023-12-06 03:06:29.000000 [  main ] Adding event for listening socket (9)
2023-12-05 22:07:56    INFO 2023-12-06 03:07:56.000000 [  main ] Accepted connection from 127.0.0.1:48002
2023-12-05 22:07:56    INFO 2023-12-06 03:07:56.000000 [     4 ] Peer connection has called close()
2023-12-05 22:07:56    INFO 2023-12-06 03:07:56.000000 [     4 ] Disconnected 127.0.0.1:48002
2023-12-05 22:07:56    INFO 2023-12-06 03:07:56.000000 [     4 ] Gear connection disconnected: -:-
2023-12-05 22:08:03    INFO 2023-12-06 03:08:02.000000 [  main ] Accepted connection from 127.0.0.1:48016
2023-12-05 22:08:03    INFO 2023-12-06 03:08:02.000000 [     3 ] Peer connection has called close()
2023-12-05 22:08:03    INFO 2023-12-06 03:08:02.000000 [     3 ] Disconnected 127.0.0.1:48016
2023-12-05 22:08:03    INFO 2023-12-06 03:08:02.000000 [     3 ] Gear connection disconnected: -:-
2023-12-05 22:08:13    INFO 2023-12-06 03:08:12.000000 [  main ] Accepted connection from 127.0.0.1:43976
2023-12-05 22:08:13    INFO 2023-12-06 03:08:12.000000 [     2 ] Peer connection has called close()
2023-12-05 22:08:13    INFO 2023-12-06 03:08:12.000000 [     2 ] Disconnected 127.0.0.1:43976
2023-12-05 22:08:13    INFO 2023-12-06 03:08:12.000000 [     2 ] Gear connection disconnected: -:-

Support mysql backend

Hey, can you add support for mysql queue backend ? Now im doing it myself :(

I added install mariadb-dev package and --with-mysql=yes, container started and created table and running.
You can check details on(I removed redis support from my image - it need compatible check) https://github.com/SAREhub/Servitiom/tree/first_version/gearmand and https://github.com/SAREhub/Servitiom/blob/first_version/bin/test/gearmand/deploy.sh

Now Im adding support for docker secretes for MYSQL_PASSWORD

License

I noticed there is no license on the repository. Could you give any information on this?

SSL cannot obtain certificate

Hi

I am trying to run gearman 1.1.19.1 with SSL with no luck!

gearmand: Could not open log file "/var/log/gearmand/gearmand.log", from "/", switching to stderr. (No such file or directory)
  FATAL  [  main ] SSL_CTX_use_PrivateKey_file() cannot obtain certificate /gearmand/gearmand.key -> libgearman-server/plugins/protocol/gear/protocol.cc:513
  FATAL  [  main ] SSL_CTX_check_private_key() cannot check certificate /gearmand/gearmand.key -> libgearman-server/plugins/protocol/gear/protocol.cc:519

I follow these steps to create a certificate.
https://github.com/gearman/gearmand/blob/master/docs/source/gearmand/ssl.rst

Thanks.

Kubernetes

Hello. When creating a pod + service, gearmand stops working.

LOG
INFO 2021-09-03 04:46:16.396362 [ main ] Initializing Gear on port tcp://10.101.82.102:4730 with SSL: false
INFO 2021-09-03 04:46:16.000000 [ main ] Starting up with pid 1, verbose is set to INFO
ERROR 2021-09-03 04:46:16.000000 [ main ] 0.0.0.0:tcp://10.101.82.102:4730 getaddrinfo(Unrecognized service) -> libgearman-server/gearmand.cc:626
INFO 2021-09-03 04:46:16.000000 [ main ] Shutdown complete

containers:

  • name: gearmand
    image: artefactual/gearmand:latest
    args:
    • --listen=0.0.0.0
    • --port=4730
      ports:
    • containerPort: 4730

If you deploy the pod, and deploy the service after germand initialization. Then germand works.
If you deploy pod and service together, an error occurs and gearmand goes into shutdown.

entrypoint.sh - KEEPALIVE_INTERVAL

Please fix the following:

KEEPALIVE_IDLE=${KEEPALIVE_IDLE:-30}
KEEPALIVE_INTERVAL=${KEEPALIVE_IDLE:-10}
->
KEEPALIVE_IDLE=${KEEPALIVE_IDLE:-30}
KEEPALIVE_INTERVAL=${KEEPALIVE_INTERVAL:-10}

Thanks

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.