marka2g / belly_bot Goto Github PK
View Code? Open in Web Editor NEWEngineering Challenge - The BellyBot Food Truck App
Engineering Challenge - The BellyBot Food Truck App
Target: add a point
db type to food_trucks
table/schema
โ point: %Geo.Point{coordinates: {truck.lng, truck.lat}, srid: 4326}
Add all of the AWS resources that will allow you to deploy your application
to a remote single-node to your Terraform configuration. (Making the
resources support a multi-node will be in another task). Required: an EC2
instance, a VPC, a security group, and an SSH key pair.
The PostGIS adds storing, indexing, and querying geo-spatial data support to Postgres.
Currently, there is a blocker on ARM chips which is preventing an asdf Postgres installation
from creating a PostGIS extension.
the docker postgis image doesn't seem to support arm chips
asdf-postgres issue #5 discussing how to install postgis for an asdf postgres install
Implement a CI pipeline that includes all of the necessary steps when
delivering an Elixir application: code compilation, dependency caching,
testing, code formatting, an unused dependency check.
Turn this feature off for now & re-implement once branch set to public
Adapt your AWS Terraform configuration to use an Auto Scaling Group so that
your Elixir application scales up/down depending on the average CPU usage of
the EC2 intances in that group.
Update the deployment keys of your Phoenix Live View application so that
it automatically rolls back to a previous version if the image you want
to deploy does not start properly.
This stage copies the release built in the builder stage and uses it as the
entrypoint of your Docker image with the minimum system requirement to run
it.
Currently, the fooditems
string that is returned the SF food truck data has a few differing patterns. Map this string to improve search.
Revise your Terraform configuration so that it can support a multi-node
swarm. To do this, create more than one EC2 instance and distribute it
across 3 availibility zones.
Use Packer to create a custom AMI for your EC2 instances and then link it
to your existing AWS Terraform infrastructure. This AMI should pre-install
Docker and netcat.
Build out an MVP Phoenix Live View App.
Create a Docker Compose file that includes a PostgreSQL database and your
Phoenix Live View application.
Create an alert so that you are notified any time the average CPU of your
Elixir applications reaches above 50%.
Once an EC2 instance is deployed and available to navigate to, ec2-54-193-68-139.us-west-1.compute.amazonaws.com:4000
-> 2500k network panel errors ensue.
GET http://ec2-54-193-68-139.us-west-1.compute.amazonaws.com:4000/live/longpoll?_csrf_token=ExEsFRwaeBU7FBAJIDsoajNCaT1vKQtRrKaDxTUpcmcALcC8Gz0_XCs8&_track_static[0]=http://ec2-54-193-68-139.us-west-1.compute.amazonaws.com:4000/assets/app-a86ae2aa16a2e20e835a380067392207.css?vsn=d&_track_static[1]=http://ec2-54-193-68-139.us-west-1.compute.amazonaws.com:4000/assets/app-a7b7a1bb2570182b93179aee6863d1bb.js?vsn=d&_mounts=0&_live_referer=undefined&vsn=2.0.0&=
Currently, the dayshours
string that s returned from SF food truck data has multiple patterns. Write a function to extract significant bits of data to improve search.
Automate the pushing of your Docker image to the GitHub Docker registry if
your CI pipeline passes. Authentication with the registry is required before
being able to push. You should create three tags for your Docker image: one
matching the commit it refers to, one matching the PR number (if present),
and other that is "latest".
Use Loki, Promtail agent to collect the logs for your Docker containers and
Grafana to display them. Then use Prometheus/PromEx to collect the
metrics exposed by the main libraries used in an Elixir application.
Currently, running seeds populate the food truck data, once. This will not suffice. Add Oban and build a nightly task to fetch and refresh the SF food truck data.
Once the dynamic_private_key.pem
key has been ssh-add
ed and the currently running instance's IP has been written to your local known_hosts
file, use the DOCKER_HOST
env var to connect to an iex
session.
example:
$
ssh-add ./environments/production/dynamic_private_key.pem
$
ssh-keyscan -H 54.193.68.139 >> ~/.ssh/known_hosts
connect to an iex>
REPL
$
DOCKER_HOST=ssh://[email protected] iex -S mix
and seed some data
iex> BellyBot.GlobalSetup.seed_food_trucks() # check the food truck count iex> BellyBot.FoodTrucks.list_food_trucks() |> Enum.count()
ISSUE:
The data gets seeded but is not showing up in the application. Perhaps the docker instance and volume are not communicating? More investigation needed.
The builder stage packages all the tools and compile-time dependencies for
your application. A mix release will be copied in the
running stage.
Error: /home/runner/work/belly_bot/belly_bot/./.github/actions/deploy/action.yaml (Line: 42, Col: 7): There's not enough info to determine what you meant. Add one of these properties: run, shell, uses, with, working-directory
Error: System.ArgumentException: Unexpected type '' encountered while reading 'steps item uses'. The type 'StringToken' was expected.
at GitHub.DistributedTask.ObjectTemplating.Tokens.TemplateTokenExtensions.AssertString(TemplateToken value, String objectDescription)
at GitHub.DistributedTask.Pipelines.ObjectTemplating.PipelineTemplateConverter.ConvertToStep(TemplateContext context, TemplateToken stepsItem, ReferenceNameBuilder nameBuilder)
at GitHub.DistributedTask.Pipelines.ObjectTemplating.PipelineTemplateConverter.ConvertToSteps(TemplateContext context, TemplateToken steps)
at GitHub.Runner.Worker.ActionManifestManager.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String fileRelativePath, MappingToken outputs)
at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)
Error: Failed to load /home/runner/work/belly_bot/belly_bot/./.github/actions/deploy/action.yaml
Use Docker secrets to hide the values to the following variables in your
Docker Compose file: DATABASE_URL, POSTGRES_PASSWORD, and SECRET_KEY_BASE.
Add a new GitHub action to your CI/CD pipeline that automatically deploys
your Phoenix Live View application any time any code is merged into the main
branch of your repository. This action should use the build tags that are
created in the CI pipeline.
Make the different instances of your Phoenix Live View Application form part
of a distributed Erlang cluster. Do this using the libcluster library after
you start the application as an Erlang node.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.