Skip to content

Extended Local Setup #415

New issue

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

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

Already on GitHub? Sign in to your account

Merged

Conversation

meshde
Copy link
Contributor

@meshde meshde commented Nov 28, 2019

Local Docker Setup for tc-project-service

Non-Topcoder Services

  • The docker-compose.yml file under local/full extends the all services present in local/docker-compose.yml using the extends keyword.
  • Apart from these, it also runs zookeeper and kafka services on ports 2181 and 9092 respectively.
  • A separate PostgresSql instance is also run for tc-notifictations. No host port is mapped to this, and is only available internally by other services on port 5432.
  • A special kafka client service with the name kafka-client has been included. The sole purpose of this service is to create all topics listed under local/full/kafka-client/topics.txt. The service exists after all topics have been created.

Topcoder Services

  • All Topcoder services would be created extending from a generic base configuration, local/full/generic-tc-service/Dockerfile
  • Containers for different services are spawned based on the build args GIT_URL and GIT_BRANCH
  • The base configuration takes another build arg BYPASS_TOKEN_VALIDATION, which if set to 1 will add the required line to bypass token validation in node_modules/tc-core-library-js/lib/auth/verifier.js.
  • Any service extending the base configuration can be forced to wait for a particular service/container to exit before starting it's main task. This has been used to make the kafka processing services wait for thekafka-client to create all required topics and exit.
  • All such services can connect with the host machine using the hostname host.docker.internal. This hostname works out of the box for the "Docker For Mac" application. To handle the case of Linux based hosts, an entry is made into /etc/hosts on conatiner startup such that it resolves to the host IP.
  • There is also a base configuration for the tc-notifications service. Three services extend this base configuration, one for each of the three commands:
    • npm run start
    • npm run startAPI
    • npm run reset:db

@meshde meshde changed the title Add local docker configuration setup with multiple tc services Extended Local Setup Nov 28, 2019
Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

This PR has been reviewed during the challenge and works perfect http://www.topcoder.com/challenge-details/30106694/?type=develop.

@maxceem
Copy link
Contributor

maxceem commented Nov 29, 2019

FYI @vikasrohit now we have a way to run Connect App with Project Service locally pretty easily. This is available in v5 branch.

@maxceem maxceem merged commit be40931 into topcoder-platform:v5-upgrade Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants