Skip to content

Commit 33a7754

Browse files
authored
Merge pull request #76 from dwyl/deploy-fyl.io-issue-#72
Fly.io Deployment #72
2 parents 533908e + 683a3e2 commit 33a7754

File tree

3 files changed

+151
-45
lines changed

3 files changed

+151
-45
lines changed

Diff for: README.md

+40-45
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# Learn DevOps
22

33
Learn the craft of "DevOps" (Developer Operations)
4-
to _easily/reliably_ deploy your App and keep it Up!
4+
to _reliably_ deploy your App and keep it Up!
55

66
![devops-process](https://user-images.githubusercontent.com/194400/28494977-ce74a632-6f36-11e7-9f86-f48abde49479.png)
77

88
## Why?
99

1010
You should learn more "advanced" DevOps if:
1111

12-
+ You / your team have "out-grown"
13-
[Heroku](https://github.com/dwyl/learn-heroku)
14-
(_e.g: your Heroku bill is more than $100/month_)
15-
+ You want "more control" over your infrastructure
16-
e.g: to run a specific version of software or database.
17-
+ Your client/boss has instructed you
18-
to use a _specific_ "cloud" provider.
19-
+ Curiosity to extend your
20-
"back end infrastructure" knowledge to be a more
21-
"well-rounded" developer.
12+
- You / your team have "out-grown"
13+
[Heroku](https://github.com/dwyl/learn-heroku)
14+
(_e.g: your Heroku bill is more than \$100/month_)
15+
- You want "more control" over your infrastructure
16+
e.g: to run a specific version of software or database.
17+
- Your client/boss has instructed you
18+
to use a _specific_ "cloud" provider.
19+
- Curiosity to extend your
20+
"back end infrastructure" knowledge to be a more
21+
"well-rounded" developer.
2222

2323
## What?
2424

@@ -31,49 +31,47 @@ to use a _specific_ "cloud" provider.
3131
## Who?
3232

3333
Everyone that wants to _seriously consider/call_ themself
34-
a "***Full Stack***" **Developer** ***must*** know how to deploy,
34+
a "**_Full Stack_**" **Developer** **_must_** know how to deploy,
3535
_secure_ and _monitor_ their app on their chosen infrastructure.
3636

37-
3837
## How?
3938

4039
Over the years we @dwyl have deployed/managed Apps,
4140
both our own and those of our clients,
4241
on a wide variety of infrastructure and platform providers.
4342

4443
_Most_ of our Apps have been deployed to **Amazon Web Services** ("**AWS**")
45-
e.g: https://www.sciencemuseum.org.uk <br />
44+
e.g: https://www.sciencemuseum.org.uk <br />
4645
We have _several_ clients who use (_and **love**_) Heroku e.g:
4746
https://www.ellenmacarthurfoundation.org <br />
4847
For the National Health Service (NHS) in England,
49-
(_who have a major contract with Microsoft_) we deployed
50-
https://www.healthlocker.uk to Azure. <br />
48+
(_who have a major contract with Microsoft_)
49+
we deployed to Microsoft Azure. <br />
5150
We have clients who still own their own "_Bare Metal_" Servers.
5251

5352
### Provider-Specific Guides
5453

5554
We have produced a guide for each of our most-used
5655
infrastructure/platform providers:
5756

58-
+ AWS: https://github.com/dwyl/learn-amazon-web-services
59-
+ AWS Lambda: https://github.com/dwyl/learn-aws-lambda
60-
+ Azure: https://github.com/dwyl/learn-microsoft-azure
61-
+ Heroku: https://github.com/dwyl/learn-heroku
62-
+ Linode: [linode-setup.md](https://github.com/dwyl/learn-devops/blob/master/linode-setup.md)
63-
+ DigitalOcean: [nodejs-digital-ocean-centos-dokku.md](https://github.com/dwyl/learn-devops/blob/master/nodejs-digital-ocean-centos-dokku.md)
57+
- AWS: https://github.com/dwyl/learn-amazon-web-services
58+
- AWS Lambda: https://github.com/dwyl/learn-aws-lambda
59+
- Azure: https://github.com/dwyl/learn-microsoft-azure
60+
- Heroku: https://github.com/dwyl/learn-heroku
61+
- Fly.io: [fly-phoenix-setup.md](https://github.com/dwyl/learn-devops/blob/master/fly-phoenix-setup.md)
62+
- Linode: [linode-setup.md](https://github.com/dwyl/learn-devops/blob/master/linode-setup.md)
63+
- DigitalOcean: [nodejs-digital-ocean-centos-dokku.md](https://github.com/dwyl/learn-devops/blob/master/nodejs-digital-ocean-centos-dokku.md)
6464

6565
### Node.js
6666

67-
+ Node.js with Dokku:
68-
[nodejs-digital-ocean-centos-dokku.md](https://github.com/dwyl/learn-devops/blob/master/nodejs-digital-ocean-centos-dokku.md)
69-
+ Node.js "Zero Downtime" Production Deployment with PM2:
70-
[nodejs-pm2-zero-downtime.md](https://github.com/dwyl/learn-devops/blob/master/nodejs-pm2-zero-downtime.md)
71-
67+
- Node.js with Dokku:
68+
[nodejs-digital-ocean-centos-dokku.md](https://github.com/dwyl/learn-devops/blob/master/nodejs-digital-ocean-centos-dokku.md)
69+
- Node.js "Zero Downtime" Production Deployment with PM2:
70+
[nodejs-pm2-zero-downtime.md](https://github.com/dwyl/learn-devops/blob/master/nodejs-pm2-zero-downtime.md)
7271

7372
> If you would like to see a guide for a _different_ service provider,
74-
please open an issue with your suggestion(s):
75-
https://github.com/dwyl/learn-devops/issues
76-
73+
> please open an issue with your suggestion(s):
74+
> https://github.com/dwyl/learn-devops/issues
7775
7876
### Testing, Continuous Integration & Delivery
7977

@@ -87,9 +85,6 @@ Next you should be proficient with Continuous Integration.
8785
For that we recommend using Travis-CI, see:
8886
[https://github.com/dwyl/**learn-travis**](https://github.com/dwyl/learn-travis)
8987

90-
91-
92-
9388
https://github.com/dwyl/learn-travis/blob/master/encrypted-ssh-keys-deployment.md
9489

9590
<!--
@@ -118,10 +113,10 @@ _if you have time to help please comment on the issue!_
118113

119114
### Videos
120115

121-
+ What is DevOps: https://youtu.be/I7vHqXY22gg
122-
+ What is DevOps? - In Simple English: https://youtu.be/_I94-tJlovg
123-
(_good info but last minute is a RackSpace pitch_)
124-
+ DevOps for Beginners Course Introduction: https://youtu.be/v7ZcZfGBFcU
116+
- What is DevOps: https://youtu.be/I7vHqXY22gg
117+
- What is DevOps? - In Simple English: https://youtu.be/_I94-tJlovg
118+
(_good info but last minute is a RackSpace pitch_)
119+
- DevOps for Beginners Course Introduction: https://youtu.be/v7ZcZfGBFcU
125120

126121
### Background Reading
127122

@@ -132,20 +127,20 @@ _if you have time to help please comment on the issue!_
132127

133128
### Linode-specific How-tos
134129

135-
+ SSH with Public Keys:
136-
https://www.linode.com/docs/security/use-public-key-authentication-with-ssh
137-
+ Using Vagrant for Environment Management:
138-
https://www.linode.com/docs/applications/configuration-management/vagrant-linode-environments
130+
- SSH with Public Keys:
131+
https://www.linode.com/docs/security/use-public-key-authentication-with-ssh
132+
- Using Vagrant for Environment Management:
133+
https://www.linode.com/docs/applications/configuration-management/vagrant-linode-environments
139134

140135
### Using a Different Cloud Infrastructure Provider?
141136

142137
While this tutorial has focussed on using Linode,
143138
we @dwyl have _experience_ of using _several_ infrastructure providers:
144139

145-
+ Amazon Web Services: https://github.com/dwyl/learn-amazon-web-services
146-
+ Azure: https://github.com/dwyl/learn-microsoft-azure
147-
+ Digital Ocean: https://github.com/dwyl/DigitalOcean-Setup
148-
+ Heroku: https://github.com/dwyl/learn-heroku
140+
- Amazon Web Services: https://github.com/dwyl/learn-amazon-web-services
141+
- Azure: https://github.com/dwyl/learn-microsoft-azure
142+
- Digital Ocean: https://github.com/dwyl/DigitalOcean-Setup
143+
- Heroku: https://github.com/dwyl/learn-heroku
149144

150145
if you have a question specific to using Linode or one of the _other_
151146
"cloud" providers, please

Diff for: fly-phoenix-setup.md

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Fly.io
2+
3+
[fly.io](https://fly.io/about/)
4+
is a new type of Platform-as-a-Service (PaaS)
5+
for deploying web Apps/APIs
6+
closer to the people _using_ them.
7+
Much like a
8+
[Content Delivery Network](https://en.wikipedia.org/wiki/Content_delivery_network)
9+
(CDN)
10+
where there are copies of your `static` content
11+
stored on "edge" nodes close to the people (devices)
12+
_consuming_ the content,
13+
Fly.io replicates your Application
14+
so that it is closer to the people _using_ it.
15+
16+
## Why?
17+
18+
On the surface it looks like a _great_ way to deploy Elixir/Phoenix Apps
19+
and they are committed to making the experience great.
20+
21+
22+
23+
## What?
24+
25+
A new way of deploying Elixir/Phoenix apps that will continue to get better because they
26+
[_hired_ Chris McCord](https://github.com/dwyl/learn-devops/issues/72#issuecomment-917442712)
27+
(creator of Phoenix!!)
28+
29+
## Pricing?
30+
31+
Pricing seems "_fair_", or at least _comparable_ to AWS.
32+
See: [learn-devops/issues/72][https://github.com/dwyl/learn-devops/issues/72#issuecomment-945001230]
33+
34+
35+
### Venture Capital (VC) Funding?
36+
37+
Fly.io are funded by
38+
[YCombinator and a few others](https://www.crunchbase.com/organization/fly-io/company_financials)
39+
Obviously we would _prefer_ if they were independent,
40+
but we totally understand that
41+
building this kind of service requires considerable capital investment
42+
in the form of both infrastructure and engineers.
43+
44+
I suspect they are piggy-backing on AWS/GCP/etc
45+
rather than running their own servers.
46+
But they still have the job of making it all seamless.
47+
48+
<br />
49+
50+
# How?
51+
52+
Following the "_Hands on with Fly_" (getting started guide):
53+
https://fly.io/docs/hands-on/start/
54+
55+
## Instal `flyctl` CLI
56+
57+
https://fly.io/docs/hands-on/installing/
58+
59+
I'm using homebrew on mac so:
60+
61+
```sh
62+
brew install superfly/tap/flyctl
63+
```
64+
65+
## Deploy an App
66+
67+
Followed: https://fly.io/docs/getting-started/elixir/ <br />
68+
Created the PR for deploying Hits to Fly.io: https://github.com/dwyl/hits/pull/128 (detailed log in the PR)<br />
69+
70+
71+
The process for deploying a Phoenix App was a bit _long_ ... ⏳ (_lots of steps..._)<br />
72+
But the docs were good and when I got stuck their forum was useful.
73+
74+
## Metrics UI
75+
76+
The Fly.io web interface is still _very_ basic: https://fly.io/apps/hits/metrics?range=172800
77+
![fly-hits-app-metrics-http](https://user-images.githubusercontent.com/194400/140039296-ed327b71-3202-40da-ba7e-33f53bf531b1.png)
78+
79+
![fly-hits-app-metrics-etc](https://user-images.githubusercontent.com/194400/140041027-cf5f9409-3976-4d48-8b05-1d8b75ed0e74.png)
80+
81+
# Conclusion
82+
83+
Fly.io seems to be good so far.
84+
My plan is to check-in with the Hits App on Fly on a weekly basis and see how it's doing.
85+
Right now I'm just stoked that it's working and has fast response times.

Diff for: postgres/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,29 @@ You should see:
244244
```
245245

246246
Success.
247+
248+
249+
https://serverfault.com/questions/110154/whats-the-default-superuser-username-password-for-postgres-after-a-new-install
250+
251+
252+
```
253+
sudo -u postgres psql postgres -d hits_dev
254+
```
255+
256+
```
257+
\d
258+
List of relations
259+
Schema | Name | Type | Owner
260+
--------+---------------------+----------+----------
261+
public | hits | table | postgres
262+
public | hits_id_seq | sequence | postgres
263+
public | repositories | table | postgres
264+
public | repositories_id_seq | sequence | postgres
265+
public | schema_migrations | table | postgres
266+
public | useragents | table | postgres
267+
public | useragents_id_seq | sequence | postgres
268+
public | users | table | postgres
269+
public | users_id_seq | sequence | postgres
270+
(9 rows)
271+
272+
```

0 commit comments

Comments
 (0)