Skip to content

Commit 5d75df2

Browse files
authored
Merge pull request #1 from simR122/master
aws-deplyment-configured
2 parents 44d3134 + 1915e17 commit 5d75df2

7,499 files changed

Lines changed: 2207915 additions & 17 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v2
18+
with:
19+
username: ${{ secrets.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
22+
- name: Build and push Docker image
23+
uses: docker/build-push-action@v4
24+
with:
25+
context: .
26+
push: true
27+
tags: ${{ secrets.DOCKER_USERNAME }}/mlops1_hotel:latest

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ MLOPS_1_RESERVATION.egg-info
1313

1414
################## Removed cached files ##################
1515
# Uncomment the following lines to remove cached files from the repository
16-
# git rm -r --cached config/__pycache__/
16+
# git rm -r --cached config/__pycache__/
17+
18+
vendor/*

Dockerfile

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Use a lightweight Python image
2-
FROM python:slim
1+
# Use an official Python runtime as a parent image
2+
FROM python:3.9-slim
33

44
# Set environment variables to prevent Python from writing .pyc files & Ensure Python output is not buffered
55
ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -8,23 +8,20 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
88
# Set the working directory
99
WORKDIR /app
1010

11-
# Install system dependencies required by LightGBM
12-
RUN apt-get update && apt-get install -y --no-install-recommends \
13-
libgomp1 \
14-
&& apt-get clean \
15-
&& rm -rf /var/lib/apt/lists/*
11+
# Copy the current directory contents into the container
12+
COPY . /app
1613

17-
# Copy the application code
18-
COPY . .
14+
# Add the required library for LightGBM
15+
RUN apt-get update && apt-get install -y libgomp1 && rm -rf /var/lib/apt/lists/*
1916

20-
# Install the package in editable mode
21-
RUN pip install --no-cache-dir -e .
22-
23-
# Train the model before running the application
24-
RUN python pipeline/training_pipeline.py
17+
# Install any needed packages specified in requirements.txt
18+
RUN pip install --no-cache-dir -r requirements.txt
2519

2620
# Expose the port that Flask will run on
2721
EXPOSE 5000
2822

2923
# Command to run the app
30-
CMD ["python", "application.py"]
24+
CMD ["python", "application.py"]
25+
26+
27+

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
![alt text](image.png) keys
1+
![alt text](image.png) keys
2+
LIVE at: http://a4d76dacd85884eaaa2c0f1b1e173b67-1601615365.us-east-1.elb.amazonaws.com

aws/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# AWS CLI v2
2+
3+
This bundle contains a built executable of the AWS CLI v2.
4+
5+
## Installation
6+
7+
To install the AWS CLI v2, run the `install` script:
8+
```
9+
$ sudo ./install
10+
You can now run: /usr/local/bin/aws --version
11+
```
12+
This will install the AWS CLI v2 at `/usr/local/bin/aws`. Assuming
13+
`/usr/local/bin` is on your `PATH`, you can now run:
14+
```
15+
$ aws --version
16+
```
17+
18+
19+
### Installing without sudo
20+
21+
If you don't have ``sudo`` permissions or want to install the AWS
22+
CLI v2 only for the current user, run the `install` script with the `-b`
23+
and `-i` options:
24+
```
25+
$ ./install -i ~/.local/aws-cli -b ~/.local/bin
26+
```
27+
This will install the AWS CLI v2 in `~/.local/aws-cli` and create
28+
symlinks for `aws` and `aws_completer` in `~/.local/bin`. For more
29+
information about these options, run the `install` script with `-h`:
30+
```
31+
$ ./install -h
32+
```
33+
34+
### Updating
35+
36+
If you run the `install` script and there is a previously installed version
37+
of the AWS CLI v2, the script will error out. To update to the version included
38+
in this bundle, run the `install` script with `--update`:
39+
```
40+
$ sudo ./install --update
41+
```
42+
43+
44+
### Removing the installation
45+
46+
To remove the AWS CLI v2, delete the its installation and symlinks:
47+
```
48+
$ sudo rm -rf /usr/local/aws-cli
49+
$ sudo rm /usr/local/bin/aws
50+
$ sudo rm /usr/local/bin/aws_completer
51+
```
52+
Note if you installed the AWS CLI v2 using the `-b` or `-i` options, you will
53+
need to remove the installation and the symlinks in the directories you
54+
specified.

0 commit comments

Comments
 (0)