This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CloudFormationElasticBeanstalkApplication: | |
Type: AWS::ElasticBeanstalk::Application | |
Properties: | |
ApplicationName: !Sub ${ElasticApplicationName}-app | |
CloudFormationElasticBeanstalkEvnironmentStaging: | |
Type: AWS::ElasticBeanstalk::Environment | |
Properties: | |
ApplicationName: !Ref CloudFormationElasticBeanstalkApplication | |
EnvironmentName: !Sub ${ElasticApplicationName}-env-staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CodeBuildDockerBirdsClassifierImage: | |
Type: AWS::CodeBuild::Project | |
Properties: | |
Name: !Ref CodeBuildProjectName | |
ServiceRole: !Ref CodeBuildBirdsClassifierImageServiceRole | |
Artifacts: | |
Type: CODEPIPELINE | |
LogsConfig: | |
CloudWatchLogs: | |
Status: ENABLED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
pre_build: | |
commands: | |
- echo Build started on `date` | |
- echo List all available files | |
- ls -ll | |
- echo Delete current model folder and fetch new model from s3 | |
- rm -rf model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BUCKET_NAME=birds-classifier-model-bucket | |
AWS_ID=$(aws sts get-caller-identity --query Account --output text | cat) | |
AWS_REGION=$(aws configure get region) | |
echo "Creating bucket " | |
aws s3api create-bucket --acl public-read --bucket $BUCKET_NAME --create-bucket-configuration LocationConstraint=$AWS_REGION | |
echo "Enable versioning" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CloudFormationCodePipeline: | |
Type: AWS::CodePipeline::Pipeline | |
Properties: | |
Name: !Ref CodePipelineProjectName | |
RoleArn: !GetAtt BirdsClassifierCodePipelineServiceRole.Arn | |
Stages: | |
- Name: SourceStage | |
Actions: | |
- Name: SourceAction | |
ActionTypeId: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
deploy: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
ports: | |
- '80:5000' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.9 | |
WORKDIR /usr/src/app | |
# We copy just the requirements.txt first to leverage Docker cache | |
COPY ./requirements.txt ./ | |
RUN pip install --upgrade pip | |
RUN pip install --no-cache-dir -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load(dataset): | |
dataset.to_csv("final_dataset.csv", index=False) | |
load(df_final) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compute GDP by using GDP per capita and the Population columns | |
df_final["GDP"] = df_final["GDP per capita"] * df_final["Population"] | |
# Remove % sign of Population under 20 years old column and convert it to be of type float | |
def transform_col(col_val): | |
try: | |
return float(col_val.replace(" %", "")) | |
except: # value is NaN | |
return col_val |
NewerOlder