ecosystem-activity

command module
v0.0.0-...-f97fc23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

ecosystem-activity

Local dev

To run this locally, there's a docker-compose.yml.tmpl file at the root of the repo. It has the .tmpl extension for a reason, and it's to denote that there's some effort to customize it for your needs. But not a lot! That's what this little guide is for. Also this guide is assuming you have already cloned the repository and switched to the repo's directory.

First, copy the file over so we can make edits to it as needed without altering the template file used for this local dev guide.

cp docker-compose.yml.tmpl docker-compose.yml

Now open up this docker-compose.yml file and there are multiple environment variables in the collector service to change, and a volume for your config file.

environment:
  ECOSYSTEM_ACTIVITY_GITHUB_TOKEN: changeme

This environment variable in particular must be changed to your GitHub API token for the application to function.

Now we can create a testing configuration file. The configuration for the tool is loaded via CLI flags and environment variables. The configuration file specifies all of the repositories that are in scope for data collection by this tool. For local dev, I would recommend creating a file at the root of this repo named testconfig.yaml and populating it with one or a few repositories that you want to collect test data from. Not too many, the point is to simulate production not be production. This file, if named the same way, already has a volume mount specified in the docker-compose file for it, so nothing more should need to be changed. Here's an example minimal config with one repository selected:

individual_repositories:
  - https://github.com/Chia-Network/go-chia-libs

At this point just run the following to start the application:

docker-compose up --build

NOTE: You may run into issues where just re-upping the collector container isn't good enough. If you suspect you've malformed rows in a table in a previous attempt, spin the containers down first and cull the DB volume with:

docker-compose down --volumes

You should see loglines flow in for the collector image to build. Then the mysql database container should start up. Once mysql is ready to accept connections the collector container should start and you'll see logs flow in at a debug level if you didn't change the ECOSYSTEM_ACTIVITY_LOG_LEVEL environment variable. If you make changes to the application code, just ctrl+c out of the docker-compose log stream, and re-run docker-compose up --build in your shell, and you're off to the races.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL