Más contenido relacionado
La actualidad más candente (19)
Similar a Set up a Development Environment in 5 Minutes (20)
Más de Akamai Developers & Admins (20)
Set up a Development Environment in 5 Minutes
- 1. © 2020 Akamai1
Set Up a
Development
Environment
in 5 Minutes
A step by step guide to setting up
a development environment with
Akamai Docker
- 6. © 2020 Akamai6
Akamai at a glance
A global platform
137 countries
1,700 networks
3,900 locations
260,000 servers
Generating
insights
100 million IP
addresses/day
1.3 billion device
interactions/day
7.5 petabytes
processed/day
Accelerating
daily traffic of
40 million hits/second
2+ trillion
deliveries/day
50+ Terabits/second
with 160+
Tbps Peaks
Supported by
7,000+ employees
60+ global offices
8 global 24/7
operations centers
Data Source: Akamai Intelligent Edge Platform. January 2020.
- 7. © 2020 Akamai7
Setting up an Akamai Developer Environment
Concepts
Continuous Integration
Automate build and test activities anytime
a user makes a code change
Continuous Delivery
Automate build, test, and release activities
anytime a user makes a code change
Continuous Deployment
Automate build, test, release, and deploy
activities anytime a user makes a code changeCONTINUOUS ANYTHING = AUTOMATION
- 9. © 2020 Akamai9
Why Docker? $ time docker run --rm -it -v $HOME/.edgerc:/root/.edgerc:ro --name
akamai akamai/akamai-docker akamai --version
akamai version 1.1.5
docker run --rm -it -v $HOME/.edgerc:/root/.edgerc:ro --name akamai
akamai 0.04s user 0.02s system 3% cpu 1.464 total
$
Alpine
Node.js
akamai
Python 2
vim
Python 3
HTTPie
go
curl
pip
tree jdk8
nano
jq
bash
terraform openssl
wget
git
libffi
dep
npm
docker
CONTAINER
- 11. © 2020 Akamai11
● Explained Goal
● Agreed on:
○ Scope
○ who does what
○ how to communicate
○ what technologies to use
(GitHub, Docker Hub)
○ Timelines
○ Next steps
● Assigned action items for next steps
● Integrated TravisCI (monthly build)
● Added:
○ .travis.yml
○ Automation scripts
○ Slack Build notifications
● Discussed Next Steps (image
variants)
● Pushed first image to Docker Hub
● Started with an existing file
● Collaborated to add:
○ Owner info
○ .gitignore
○ Copyright & License
○ Readme
● Enabled Auto-Deploy to Docker Hub
● Assigned action items for next steps
DevOps, Agile and Lean Methodologies
3 people, 3 countries, 3 working sessions
April 15April 9 April 17
AutomationDockerfileInitial Meeting
- 12. © 2020 Akamai12
Continuous Deployment Workflow
Dockerfile .travis.yml akamai/akamai-docker Build #12 of
akamai/akamai-docker@master
passed in 12 mins.
- 17. © 2020 Akamai17
Docker Image Size Optimizations
FROM alpine:3.11 as base
FROM base as builder
ARG AKAMAI_CLI_HOME=/cli
ENV AKAMAI_CLI_HOME=$AKAMAI_CLI_HOME GOROOT=/usr/lib/go GOPATH=/go GO111MODULE=auto PATH=$PATH:$GOBIN
RUN mkdir -p $AKAMAI_CLI_HOME/.akamai-cli
RUN apk add --no-cache docker git bash python2 python2-dev py2-pip python3 python3-dev npm wget jq openssl
openssl-dev curl nodejs build-base libffi libffi-dev vim nano util-linux go dep tree bind-tools
RUN go get -d github.com/akamai/cli && cd $GOPATH/src/github.com/akamai/cli && go mod init && go mod tidy && go
build -o /usr/local/bin/akamai
RUN pip install --upgrade pip && pip3 install --upgrade pip
RUN curl -s https://developer.akamai.com/cli/package-list.json -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS
X 10.10; rv:42.0) Gecko/20100101 Firefox/42.0" | jq '.packages[].name' | sed s/"//g | xargs akamai install --force
RUN go get github.com/spf13/cast && akamai install cli-api-gateway
# https://github.com/akamai/cli-sandbox/issues/24
RUN akamai install sandbox && cd $AKAMAI_CLI_HOME/.akamai-cli/src/cli-sandbox/ && npm run build
RUN cd $AKAMAI_CLI_HOME/.akamai-cli/src/cli-edgeworkers/ && npm run build
WORKDIR /wheels
RUN pip install wheel
RUN pip wheel httpie httpie-edgegrid cffi
FROM base
ARG AKAMAI_CLI_HOME=/cli
- 18. © 2020 Akamai18
Docker Image Variants
#####################
# BUILD ARGS
#########
ARG BASE=akamai/base
#####################
# BUILDER
#########
FROM node:alpine as builder
RUN apk add --no-cache git npm
# install cli-property from git
# (akamai install does not add the --production flag, which increases
# the footprint of the package since devDependencies are installed)
&& git clone --depth 1 https://github.com/akamai/cli-property.git
&& cd cli-property
&& npm install --production
#####################
# FINAL
#########
FROM $BASE
RUN apk add --no-cache nodejs
&& mkdir -p /cli/.akamai-cli/src
COPY --from=builder /cli-property /cli/.akamai-cli/src/cli-property
ENTRYPOINT ["/cli/.akamai-cli/src/cli-property/bin/akamaiProperty"]
...
SHELL
360MB
APPSEC
51 MB
ADAPTIVE
ACCELERATION
40 MB
BASE
5 MB
PROPERTY
66 MB
...
- 20. © 2020 Akamai20
Demos
1. Setting up the Development Environment
2. Web Operations
3. Media publishing
4. Security
5. DevOps
- 21. © 2020 Akamai21
Setting up the
Akamai Development
Environment
● Provision API Access
● Install Docker Desktop
● Install Akamai Development Environment
Demo
$ docker run -it -v $HOME/.edgerc:/root/.edgerc:ro --name akamai akamai/akamai-docker
Unable to find image 'akamai/akamai-docker:latest' locally
latest: Pulling from akamai/akamai-docker
cbdbe7a5bc2a: Pull complete
61bc2d5ce3bb: Pull complete
9c0484786baa: Pull complete
3f382dfdc1a6: Pull complete
4198704f8a89: Pull complete
accf7413945d: Pull complete
ee5d7f0cd1d3: Pull complete
8a416004e68b: Pull complete
3b4b5269d525: Pull complete
b7a187f231b9: Pull complete
ffc2604dc2ba: Pull complete
5b7a8ab46262: Pull complete
d329d6aeb9f5: Pull complete
f280ab158c66: Pull complete
56c836b880f2: Pull complete
c0f7981b2f07: Pull complete
Digest: sha256:c0ac240cf88f06337902dd13cb1e542af0321392c283f96fdc32c41578970eb7
Status: Downloaded newer image for akamai/akamai-docker:latest
___ __ _
/ | / /______ _____ ___ ____ _(_)
/ /| | / //_/ __ `/ __ `__ / __ `/ /
/ ___ |/ ,< / /_/ / / / / / / /_/ / /
/_/ |_/_/|_|__,_/_/ /_/ /_/__,_/_/
===============================================================
= Welcome to the Akamai Docker Image =
===============================================================
= Project page: =
= https://github.com/akamai/akamai-docker =
===============================================================
Akamai DevOps [~] >>
- 22. © 2020 Akamai22
Purging Content
● Understand Content Invalidation
● Purge Content
● Verify purge worked
Demo
$ docker run --rm -it --name akamai akamai/akamai-docker
___ __ _
/ | / /______ _____ ___ ____ _(_)
/ /| | / //_/ __ `/ __ `__ / __ `/ /
/ ___ |/ ,< / /_/ / / / / / / /_/ / /
/_/ |_/_/|_|__,_/_/ /_/ /_/__,_/_/
===============================================================
= Welcome to the Akamai Docker Image =
===============================================================
= Project page: =
= https://github.com/akamai/akamai-docker =
===============================================================
Akamai DevOps [~] >> akamai purge invalidate --tag product --staging
Purging...... [OK]
Purged 2 objects (ETA: 5 seconds)
Purge ID: b60b3da4-94ce-11ea-bb0d-fb1c0dd275d3
Akamai DevOps [~] >>
- 23. © 2020 Akamai23
{
"name": "GEO-protection-NL",
"children": [],
"behaviors": [
{
"name": "denyAccess",
"options": {
"reason": "not-NL",
"enabled": true
}
}
],
"criteria": [
{
"name": "path",
"options": {
"matchOperator": "MATCHES_ONE_OF",
"values": [
"/videos/nl/*"
],
"matchCaseSensitive": false
}
},
{
"name": "userLocation",
"options": {
"field": "COUNTRY",
"matchOperator": "IS_NOT_ONE_OF",
"countryValues": [
"NL"
],
"checkIps": "BOTH",
"useOnlyFirstXForwardedForIp": false
}
}
],
"criteriaMustSatisfy": "all"
}
Protect Media Assets
● Download property rules
● Add new functionality
● Activate new version
● Verify functionality
Demo
- 24. © 2020 Akamai24
Protecting against
SQL Injection attacks
● Execute SQL Injection attack
● Update and activate security
configuration
● Verify attack is deflected
Demo
- 25. © 2020 Akamai25
Akamai-as-code
● Review code in source-control
● Test new code in local sandbox
● Use Jenkins pipeline to build, test and
deploy code to the Akamai staging
network
Demo
- 26. © 2020 Akamai26
Let’s Recap
Webinar Resources
Summary Collaborate with us
github.com/akamai/akamai-docker
- 27. © 2020 Akamai27
Useful Links
● developer.akamai.com
● github.com/akamai/akamai-docker
● docker.com/get-started
● hub.docker.com/r/akamai/akamai-docker
● youtube.com/akamaideveloper
● https://developer.akamai.com/development-environment-webinar