Coder Social home page Coder Social logo

fxa-dev's Introduction

AWS Ansible-based docker development environment for Firefox Accounts

Prerequisites

macOS

Use: brew install ansible && pip install boto3

Usage

To run on AWS change directory to aws

cd aws
  1. Set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables
  2. create a environments/foo.yml file ('foo' can be anything) a) see environments/EXAMPLE.yml for a base reference b) it is recommended that you set values for owner and reaper_spare_me
  3. run make foo

After the cloudformation stacks has been created, cloud-init will run an initial ansible playbook to set up the box. A cronjob run every 10 minutes will pick up changes as needed. The logs for the initial playbook run are in /var/log/cloud-init-output.log. If the cloudformation was created OK, but the services do not come up, check that log output for why.

SSH

You can ssh into the EC2 instance with ssh ec2-user@meta-{{ whatever you configured in foo.yml }}.

Custom Docker tags

By default, the latest tag will be used. This can be adjusted to use other image tags by setting any of {auth_docker_tag, authdb_docker_tag, content_docker_tag, customs_docker_tag, oauth_docker_tag, profile_docker_tag, rp_docker_tag} in your environments/foo.yml configuration file.

NOTE: you must commit and push changes to that file to affect an existing EC2 instance.

Docker stopped|started:

By default, all docker containers are 'started'. If you want to selectively keep a service 'stopped', you can set any of {auth_docker_state, authdb_docker_state, basket_docker_state, content_docker_state, customs_docker_state, oauth_docker_state, profile_docker_state, rp_docker_state} in your environments/foo.yml configuration file.

NOTE: you must commit and push changes to that file to affect an existing EC2 instance.

Custom fxa-dev branch

You can control the branch of fxa-dev for each environment by changing the {fxadev_git_version} value in the environment configuration file.

Layout Notes

  • fxa sources are in /data/fxa-dev.
  • node processes are run by docker
    • config is setup by ansible docker_container module (e.g., roles/auth/tasks/main.yml)
    • run docker ps; docker images for info
  • ansible will do a docker pull, and restart the container if the image, or configuration, has changed.
  • nginx is the web frontend
    • config in /etc/nginx/conf.d
  • node process logs are available with, e.g., docker logs auth-server.

Example urls

About using docker_container and quoting of environment values

docker_container (>=2.8) now insists that environment values be quoted. However, when evaluating "{{ foo }}", those quotes are removed. So use the to_json jinja2 filter to ensure that the value is quoted. Note: I use to_json instead of quote because quote will not quote Boolean values true and false.

If not quoted, the error will look like "Non-string value found for env option. Ambiguous env options must be wrapped in quotes to avoid them being interpreted. Key: ENV_VAR_NAME". If you see this error, add a to_json in your templates and try again.

fxa-dev's People

Contributors

jrgm avatar vladikoff avatar dannycoates avatar rfk avatar vbudhram avatar seanmonstar avatar ckarlof avatar jbuck avatar philbooth avatar udaraweerasinghege avatar zaach avatar mstriemer avatar kparlante avatar bbangert avatar chilts avatar ckolos avatar jaredhirsch avatar johngruen avatar lzoog avatar lmorchard avatar mozilla-github-standards avatar nchapman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.