Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix Docker configuration for Gitlab CI #2610

Merged
merged 2 commits into from
Jun 21, 2020

Conversation

Andrew-Chen-Wang
Copy link
Contributor

Description

  • Just missing the services I believe according to @rocode?

This should provide the temporary fix for GitLab CI #2549

Rationale

Quick fix for those using GitLab CI

Use case(s) / visualization(s)

  • I'm hoping to just completely eradicate the need for this setup with a follow-up PR for completely non-Docker approach on CI that supports celery, too.

* Just missing the services I believe according to @rocode?
* I'm hoping to just completely eradicate the need for this setup with a follow-up PR for completely non-Docker approach on CI that supports celery, too.
Copy link

@rocode rocode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, note that you need the docker:dind service as well, or it will fail when trying to connect to the containers.

services:
    - docker:dind

@Andrew-Chen-Wang
Copy link
Contributor Author

Thanks @rocode! Also, I've configured Travis to use a non Docker approach which cuts down the CI runtime by 1.5 minutes. Do you mind if I ping you again so that you can test that PR (when I find the time to copy and paste the config file and rewrite the tests) on Gitlab CI?

@rocode
Copy link

rocode commented May 29, 2020

Thanks @rocode! Also, I've configured Travis to use a non Docker approach which cuts down the CI runtime by 1.5 minutes. Do you mind if I ping you again so that you can test that PR (when I find the time to copy and paste the config file and rewrite the tests) on Gitlab CI?

Sounds good! Our current CI is about ~5 minutes, so that will be very appreciated.

@Andrew-Chen-Wang
Copy link
Contributor Author

@rocode Ah, I might as well get you started. My current Travis configuration is extremely wacky at the moment, but the gist of it, in Travis, is to use the built-in services. To avoid the entire Docker thing, you just need to add the environment variables that are in the .envs directory.

AFAIK in my config, that would be:

- USE_DOCKER="no"
- DATABASE_URL="postgres:///mydatabase"
- REDIS_URL="redis://localhost:6379/0"
- CELERY_BROKER_URL="redis://localhost:6379/0"

and my services are Postgres and Redis.

For celery, use this: - celery multi start beat worker -A config.celery_app --pool=solo

And your script should be pytest.

@browniebroke browniebroke merged commit 8b3ee3c into cookiecutter:master Jun 21, 2020
@Andrew-Chen-Wang Andrew-Chen-Wang deleted the patch-2 branch June 21, 2020 17:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants