Skip to content

Commit

Permalink
Merge branch 'cristim-sql-server-licenses'
Browse files Browse the repository at this point in the history
  • Loading branch information
EverettBerry committed Feb 19, 2024
2 parents 25c4605 + 24f3afa commit 61b4ad7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 12 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ FROM ubuntu:20.04

ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ARG AWS_SESSION_TOKEN
ARG DEBIAN_FRONTEND=noninteractive

LABEL org.opencontainers.image.authors="Sebastian Sasu <sebi@nologin.ro>, Cristian Magherusan-Stanciu <cmagh@amazon.de>, Brooke McKim <brooke@vantage.sh>"
LABEL org.opencontainers.image.authors="Sebastian Sasu <sebi@nologin.ro>, Cristian Magherusan-Stanciu <cristi@leanercloud.com>, Brooke McKim <brooke@vantage.sh>"

RUN apt-get update > /dev/null
RUN apt-get install -y python3 pip locales libxml2-dev libxslt-dev nodejs npm > /dev/null
Expand All @@ -14,11 +15,16 @@ RUN locale-gen "en_US.UTF-8"

WORKDIR /opt/app

# install dependencies into a dedicated Docker layer, to speed up subsequent builds a bit
COPY requirements.txt .
RUN pip3 install -r requirements.txt

COPY . .

RUN pip3 install -r requirements.txt
RUN invoke build

EXPOSE 8080

ENV HTTP_HOST=0.0.0.0

CMD ["invoke", "serve"]
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,18 @@ docker build -t ec2instances.info .

3. Run a container from the built `docker` image:

```bash
````bash
docker run -d --name some-container -p 8080:8080 ec2instances.info
```

4. Open [localhost:8080](http://localhost:8080) in your browser to see it in action.

## Docker Compose

Here's how you can build and run docker image using Docker Compose (tested with Docker Compose v2):
```bash
docker-compose up
````
4. Open [localhost:8080](http://localhost:8080) in your browser to see it in action.
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'
services:
ec2instances.info:
build:
context: .
args:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
ports:
- '8080:8080'
4 changes: 2 additions & 2 deletions in/rds.html.mako
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
</th>
% endfor

% for platform, code in {'MySQL': '2', 'SQL Server Standard': '12', 'Aurora Postgres & MySQL': '21', 'Aurora I/O Optimized': '211', 'MariaDB': '18', 'Oracle Enterprise': '5'}.items():
% for platform, code in {'MySQL': '2', 'SQL Server Express': '10','SQL Server Web': '11','SQL Server Standard': '12','SQL Server Enterprise': '15', 'Aurora Postgres & MySQL': '21', 'Aurora I/O Optimized': '211', 'MariaDB': '18', 'Oracle Enterprise': '5'}.items():
<th class="cost-ondemand cost-ondemand-${code}">${platform} On Demand Cost</th>
% if code != '211':
<th class="cost-reserved cost-reserved-${code}">
Expand Down Expand Up @@ -257,7 +257,7 @@
</td>
% endfor

% for platform, code in {'MySQL': '2', 'SQL Server Standard': '12', 'Aurora Postgres & MySQL': '21', 'Aurora I/O Optimized': '211', 'MariaDB': '18', 'Oracle Enterprise': '5'}.items():
% for platform, code in {'MySQL': '2', 'SQL Server Express': '10', 'SQL Server Web': '11', 'SQL Server Standard': '12','SQL Server Enterprise': '15', 'Aurora Postgres & MySQL': '21', 'Aurora I/O Optimized': '211', 'MariaDB': '18', 'Oracle Enterprise': '5'}.items():
<td class="cost-ondemand cost-ondemand-${code}" data-platform='${code}' data-vcpu='${inst['vcpu']}' data-memory='${inst['memory']}'>
% if inst['pricing'].get('us-east-1', {}).get(code, {}).get('ondemand', 'N/A') != "N/A":
<span sort="${inst['pricing']['us-east-1'][code]['ondemand']}">
Expand Down
12 changes: 6 additions & 6 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,9 +1058,9 @@ def add_availability_zone_info(instances):
availability_zones.append(availability_zone_id)
availability_zones.sort()
region_availability_zones[region_name] = availability_zones
instance_type_region_availability_zones[
instance_type
] = region_availability_zones
instance_type_region_availability_zones[instance_type] = (
region_availability_zones
)
for inst in instances:
inst.availability_zones = instance_type_region_availability_zones.get(
inst.instance_type, {}
Expand Down Expand Up @@ -1186,9 +1186,9 @@ def fetch_dedicated_prices():
if inst_type not in all_pricing[region]:
all_pricing[region][inst_type] = {"reserved": {}}

all_pricing[region][inst_type]["reserved"][
translate_ri
] = format_price(price)
all_pricing[region][inst_type]["reserved"][translate_ri] = (
format_price(price)
)

return all_pricing

Expand Down

0 comments on commit 61b4ad7

Please sign in to comment.