Page MenuHomePhabricator

Investigation: Create a development environment for Event Metrics
Open, Needs TriagePublic

Description

As we continue development for grantmetrics/Event tool, our stack becomes more robust. It would be very beneficial to both the maintainers and any further volunteers to have a standard development environment that they can instantly load and, with an accompanying tunnel to the replicas, run the system locally.

This investigation should look into:

  • The option of creating docker containers that include grantmetrics' stack (symfony4 web, mysql, redis, etc)
  • Docker seems to be the most straight forward approach, but are there any other options that are better
  • Can we create an instance that takes Docker environment variables (.env) into app/config/parameters.yml, so that when the docker runs "composer install" we don't get the step-by-step first-install ...?
  • Can the docker build work with the tunnel consistently

We can take a look at what was done for InteractionTimeline, which also uses a tunnel to the replicas. Their docker setup is available in their repo:

And there are docker containers for symfony4 that can help:

The ideal would be to create a container we can then reuse for future projects that handle similar instances (symfony, a database, with or without a tunnel etc)

Event Timeline

I'm really excited about this idea. I think it could streamline a lot of our tools development and collaboration efforts. Potentially, it reaches into making deployments easier down the road.

We should also include all development peripherals to the environment:

  • Linting
    • PHP linting, eslint, csslint, with the Wikimedia base rules for all
  • GruntJS (optional)
    • Base GruntJS, can run the eslint/csslint jobs, and we can add to it as we go

Possibly more? We should add to a list of base development environment that all our projects should follow, and especially grantmetrics code now that we are about to delve into it deeper and add more features (with more people involved)

We could set up a skeleton Symfony project, based on https://github.com/symfony/website-skeleton but with the addition of docker-compose, CI stuff, etc.

I think we'd be able to come up with a skeleton that'd work out of the box, with all our extra goodies. The trickiest bits I think are to make sure upgrading/continuing work is kept as close to upstream norms as possible.

Where should I file this ticket? Has the investigation been completed? Or does this need to go to estimation? @Mooeypoo?

@jmatazzoni I think this should just be in the backlog for now. No estimate (yet) and not a blocker for release.

I think we will work on this in pieces as we continue the work on Event Metrics. But, we need to prove out the bundle and docker stuff with SVG translate before we invest in converting EM to this setup. We'll be focused on the move to VPS for EM before tackling this.

MusikAnimal renamed this task from Investigation: Create a development environment for grantmetrics (and Event tool) to Investigation: Create a development environment for Event Metrics.Nov 5 2018, 8:49 PM

It's not clear that this is the direction the team wants to move for this project. More discussions to be had before this can or should be estimated.

I'm on a new laptop now and so don't have any existing dev setup in place, so I'm going to work on this now (if no one objects).

You and your laptops.

Did we decide on a path/technology/approach for this?

:) I know. It's rather annoying. I could probably just set everything up locally as I'm used to, but it seems a good time to attempt a more reproducible environment.

I'm setting it up with Docker, locally to this project (i.e. not in the ToolforgeBundle, because there's not much common stuff). Not yet sure about all the details, but hopefully will have something to show soon.

@Samwilson Glad you got a new laptop! Is this ticket still an investigation? Maybe timebox it if that's the case.

Yes good point. I spent a few hours on this yesterday, and got this far — i.e. not working.

I'll return to it at some point but I'm afraid I got too frustrated with it and for now I've just got everything working locally again. I'm happy to continue working on this, but from the meeting yesterday it sounds like this shouldn't be a priority.

Niharika removed a project: Community-Tech-Sprint.

Pulling it out of the sprint, in that case.