{"id":28690544,"url":"https://github.com/0xIbra/docker-jobs-bundle","last_synced_at":"2025-06-14T06:05:03.638Z","repository":{"id":48413660,"uuid":"346840692","full_name":"0xIbra/docker-jobs-bundle","owner":"0xIbra","description":"Symfony bundle that offers a batch processing system with Docker containers.","archived":false,"fork":false,"pushed_at":"2022-08-21T10:21:09.000Z","size":4020,"stargazers_count":21,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-14T06:04:59.690Z","etag":null,"topics":["batch-processing","docker","php-jobs","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xIbra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-11T21:17:59.000Z","updated_at":"2024-03-07T15:00:58.000Z","dependencies_parsed_at":"2022-08-28T03:43:29.447Z","dependency_job_id":null,"html_url":"https://github.com/0xIbra/docker-jobs-bundle","commit_stats":null,"previous_names":["ibra-akv/docker-jobs-bundle"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/0xIbra/docker-jobs-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fdocker-jobs-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fdocker-jobs-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fdocker-jobs-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fdocker-jobs-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xIbra","download_url":"https://codeload.github.com/0xIbra/docker-jobs-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fdocker-jobs-bundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259768605,"owners_count":22908229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch-processing","docker","php-jobs","symfony","symfony-bundle"],"created_at":"2025-06-14T06:05:02.082Z","updated_at":"2025-06-14T06:05:03.632Z","avatar_url":"https://github.com/0xIbra.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Docker Jobs Bundle\n===================\n\u003e Symfony bundle that offers a **batch processing system** with **Docker**.\n\nUses Docker containers to run and handle your jobs.\n\n* [Need to know](#need-to-know)\n* [Docker Configuration](#docker-configuration)\n* [Installation](#installation)\n* [Configuration](#configuration)\n * [Job Entity](#job-entity)\n * [Bundle Configuration](#bundle-configuration)\n* [Next steps](#next-steps)\n  * [Console commands](docs/console.md)\n    * [Job orchestration command](docs/console.md#job-orchestration-command)\n    * [Job submission command](docs/console.md#job-submission-command)\n    * [Stop job command](docs/console.md#stop-job-command)\n    * [Orphan job cleaning command](docs/console.md#clean-orphan-jobs-command)\n  * [Job Monitoring Dashboard](docs/dashboard.md)\n\n\nNeed to know\n-------------------\nAll containers started by this bundle, are by default on the host's network.  \nSo, if you need to connect to a local database, you can with the usual `localhost|127.0.0.1`.\n\nDocker configuration\n--------------------\nDocker Engine API must be exposed on a local port in order to be able to connect.\n\n##### 1. Edit the `docker.service` which by default on debian is located at `/lib/systemd/system/docker.service`\n\nFrom this:\n```shell\n# /lib/systemd/system/docker.service\n...\nExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock\n...\n```\n\nTo this:\n```shell\n# /lib/systemd/system/docker.service\n...\nExecStart=/usr/bin/dockerd\n...\n```\n\n##### 2. Edit `/etc/docker/daemon.json` to expose docker api at `127.0.0.1:2375`\nAdd `hosts` to the json file as next:\n```json\n{\n  ...\n  \"hosts\": [\"fd://\", \"tcp://127.0.0.1:2375\"]\n  ...\n}\n```\n\n##### 3. Restart Docker completely\n```shell\nsystemctl daemon-reload\nsystemctl restart docker\nservice docker restart\n```\n\n#### Docker Image\n\nIf not already done, you must create a Docker image which will be used to execute your jobs.\n\nThis bundle allows use of different images for each job but requires a default image to fallback on when no docker image is specified at launch.\n\nInstallation\n------------\nWhen installing, you must specify the correct version of the bundle which coressponds to the Symfony version of your project.\n```shell\n# Symfony 6\ncomposer require ibra-akv/docker-jobs-bundle:~6.0\n\n# Symfony 5\ncomposer require ibra-akv/docker-jobs-bundle:~5.0\n\n# Symfony 4\ncomposer require ibra-akv/docker-jobs-bundle:~4.0\n\n# Symfony 3\ncomposer require ibra-akv/docker-jobs-bundle:~3.0\n```\n\nConfiguration\n-------------\nThe configuration process is a bit lengthy, follow all the steps shown below.\n\n* [Job Entity](#job-entity)\n* [Bundle Configuration](#bundle-configuration)\n\n\n--------------------------------------------------------------------------------\n\n\u003cbr\u003e\n\n### Job Entity\nYou must create your Job entity and extend of BaseJob class.\n```php\n\u003c?php\n\nnamespace App\\Entity;\n\nuse IterativeCode\\DockerJobsBundle\\Entity\\BaseJob;\n\nclass Job extends BaseJob\n{\n}\n\n```\nAs long as you extend it of `BaseJob`, the bundle will work correctly.\n\n--------------------------------------------------------------------------------\n\n### Bundle Configuration\nOnce you've got your Job entity and Docker image ready, the last step is to configure the bundle.\n\nIf not already done, include the bundle to your project:\n```php\n\u003c?php\n# Symfony 4\n# ./project_dir/config/bundles.php\n\nreturn [\n Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle::class =\u003e ['all' =\u003e true],\n ...\n IterativeCode\\DockerJobsBundle\\DockerJobsBundle::class =\u003e ['all' =\u003e true],\n];\n\n# Symfony 3\n# ./project_dir/app/AppKernel.php\n\n$bundles = array(\n new Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle(),\n new Symfony\\Bundle\\SecurityBundle\\SecurityBundle(),\n ...\n new IterativeCode\\DockerJobsBundle\\DockerJobsBundle(),\n)\n\n```\n**Yaml configuration**\n```yaml\n# Symfony 4\n# ./project_dir/config/packages/docker_jobs.yaml\n\n# Symfony 2 - 3\n# ./project_dir/app/config/config.yml\n\ndocker_jobs:\n class:\n   job: App\\Entity\\Job # Required\n\n docker:\n   # The URI where Docker Engine API is exposed\n   # The bundle will use this endpoint to communicate with Docker\n   docker_api_endpoint: 'http://127.0.0.1:2375' # optional (default: http://localhost:2375)\n\n   # Default docker image ID for job execution\n   # You can specify docker image when creating a job, this image will be used if no image is specified at creation.\n   default_image_id: '6c39ebee77c9'         # Required\n\n   # This parameter is required to avoid eventual errors\n   # When starting a container for your job, the user will cd into this directory.\n   container_working_dir: '/opt/symfony-project'        # Required\n\n   # This parameter is used to convert docker container dates to my timezone.\n   # Docker by default uses UTC+00:00 time, me who's residing in France, i need to add 1 hour to it for it to be correct (UTC+01:00).\n   # You can use this parameter to add or remove hours to adapt it to your timezone.\n   time_difference: '+1 hour' # Optional (default: +1 hour)\n   # time_difference: '+3 hours'\n   # time_difference: '-2 hours'\n\n runtime: # Optional\n   # This is a default concurrency limit value\n   # This value can be overridden in the job orchestrating command.\n   concurrency_limit: 4 # Optional (default: 4)\n\n```\n\nAt this point, you should have the bundle imported and working.  \nNext you need to configure the **job orchestrating command** to run non-stop.  \nCheck out the steps below.\n\n--------------------------------------------------------------------------------\n\nNext steps\n----------\n- Check out the [Console commands](docs/console.md) to get the system up and running.  \n  This step is vital to get the orchestration of job containers up and running.\n\n\n- Check out the [Monitoring dashboard](docs/dashboard.md) that you can activate if you wish.\n\n--------------------------------------------------------------------------------\n\nLicense\n-------\n\n - [Review](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xIbra%2Fdocker-jobs-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xIbra%2Fdocker-jobs-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xIbra%2Fdocker-jobs-bundle/lists"}