Set-up and customisation of a new OFN installation

Setup installations

Local development

Review the instructions of the openfoodnetwork project README to setup a local development environment.

Server provisioning

The ofn_deployment project has instructions on how to use it to provision and deploy to new servers.

Buildkite

Buildkite is used by the OFN core team to manage:

  • Continuous Integration and Testing of feature branches
  • Deployment of master to staging and then production

More notes

These probably need to end up being broken out into different pages - but to start with let’s capture the known issues and agreed approach here . .

  • currency and geographical zone import on OFN

Known issues: countries; amazon; postcodes; mandrill

##Customisation

  • basic branding changes on OFN

##Code integration process

@RohanM @pmackay @maikel - for discussion with @lawrence this afternoon

@RohanM - could you put a comment in the readme about the amazon/images issue (sounds like they need to be in the usa or something?) Thks :slight_smile:

@pmackay - As there’s a growing need to roll out new servers, I’d like to improve the documentation of our provisioning setup and make it easier for someone coming in to the project to find what they need to do to get a new server up and running.

I’ve made a start by putting some notes at the top of the git repository README files to make people aware of the other repository. So if they come across openfoodnetwork, they’ll be made aware of ofn_deployment, and vice versa.

Beyond that, it’d be great to have some sort of introduction or getting started guide. Would you be up for writing up some notes on this discourse page for that? I’m thinking it’d be good to:

  • Explain the purposes of repositories - openfoodnetwork vs ofn_deployment
  • Have some notes on how to practice / experiment with provisioning with vagrant
  • Build pipeline, buildkite, etc.
  • Anything else useful that you can think of

Let me know your thoughts.

Cheers,
Rohan

I’ve made a small tentative start :slight_smile:

Also wanting to look more at how we can improve the deployment process to dig into it during the hack days. I quite like the idea of updating ofn_deployment with a template post receive hook file that could be added to a new repo project. Does that sound ok as part of a plan? So some steps might be:

  • Update ofn_deployment to configure post receive hook, so deployment happens following a git push.
  • Update docs on how to do provisioning/deployment accounting for this. (is Discourse the best place or might a wiki page or the manual be better?)
  • Review the files under scripts/ci to make more generic so can be used for any server.
  • Test configuring another project in Buildkite to make UK deployment simpler.

Would be interested in your thoughts on how the CI scripts could be made more configurable - there are quite a lot of hardcoded paths containing openfoodweb, etc, which I assume is legacy naming of server config. I do wonder if they could be ansible too (would that make variables config easier maybe?) particularly as there are some SSH operations in there. Could it make maintainability easier? But obviously the scripts are there now and work.

Great :slight_smile: That sounds like a good plan for the hack day. I think that discourse is a good starting point for documentation and a good fallback if we’re not sure where something goes, but I think we also talked about putting the more technical documentation on the github wiki. Along those lines, what do you reckon of having the deployment docs on the ofn_deployment github wiki, and perhaps reference them from the README?

Buildkite makes it easy to pass environment variables to build scripts. So I think passing a RAILS_ROOT var might be enough to solve a lot of those problems. However, for the moment it should be possible for Aus and UK to share a build server, especially since we’d most commonly be using it at different times of the day. In that case we wouldn’t need to make any changes to the CI scripts in the short-term, apart from extending the push_to_staging script to be able to push to the UK server. Or were there other customisations you were thinking of performing?

Buildkite triggers those scripts from a checkout of the openfoodnetwork repository, so unfortunately it would be tricky for them to be provided by Ansible.

One thing I realised today is that the Ansible playbooks probably don’t include Monit/DelayedJob setup. Would that be something you could potentially tackle at the hackathon?