Skip to content
Merged

1.7.2 #191

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
28780b5
adding EC2 instructions
digitalghost-dev Oct 17, 2025
ba8fb1a
updating subnet groups
digitalghost-dev Oct 17, 2025
9d8fe15
initial commit
digitalghost-dev Oct 17, 2025
7c764b1
initial commit
digitalghost-dev Oct 19, 2025
1bd01ec
adding HCP cloud
digitalghost-dev Oct 19, 2025
08527a4
updating workspace name
digitalghost-dev Oct 19, 2025
fe3c34e
updating variable name
digitalghost-dev Oct 19, 2025
118e479
adding non-root user
digitalghost-dev Oct 19, 2025
ac4418f
removing private subnets
digitalghost-dev Oct 19, 2025
0bce206
adding schedule for pricing_data
digitalghost-dev Oct 19, 2025
e4f477c
updating test data
digitalghost-dev Oct 19, 2025
321c4d5
updating test data
digitalghost-dev Oct 19, 2025
d991b6f
Merge remote-tracking branch 'origin/1.7.2' into 1.7.2
digitalghost-dev Oct 19, 2025
6ee6a86
updating egg group names to modern equivalents (#190)
digitalghost-dev Oct 19, 2025
adf217e
fixing accidental duplicate code (#190)
digitalghost-dev Oct 19, 2025
7592556
updating version numbers
digitalghost-dev Oct 19, 2025
724ab7f
fixing hyperlink
digitalghost-dev Oct 19, 2025
3c7fde0
updating version numbers
digitalghost-dev Oct 19, 2025
463f283
fixing formatting
digitalghost-dev Oct 19, 2025
488d96e
fixing typo
digitalghost-dev Oct 19, 2025
7210fc8
refactor load_pricing_data for explicit asset dependency
digitalghost-dev Oct 19, 2025
9f0af93
introduce pricing_pipeline_job and update schedule
digitalghost-dev Oct 19, 2025
812c234
Merge remote-tracking branch 'origin/1.7.2' into 1.7.2
digitalghost-dev Oct 19, 2025
7033297
fixing imports
digitalghost-dev Oct 20, 2025
ec9d28c
renaming function
digitalghost-dev Oct 20, 2025
fccbd45
adding asset key to pricing_data source
digitalghost-dev Oct 20, 2025
bd9cf97
simplifying file, reducing code
digitalghost-dev Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
- main

env:
VERSION_NUMBER: 'v1.7.1'
VERSION_NUMBER: 'v1.7.2'
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
AWS_REGION: 'us-west-2'

Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ builds:
- windows
- darwin
ldflags:
- -s -w -X main.version=v1.7.1
- -s -w -X main.version=v1.7.2

archives:
- formats: [ 'zip' ]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN go mod download

COPY . .

RUN go build -ldflags "-X main.version=v1.7.1" -o poke-cli .
RUN go build -ldflags "-X main.version=v1.7.2" -o poke-cli .

# build 2
FROM --platform=$BUILDPLATFORM alpine:3.22
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
<img height="250" width="350" src="pokemon.svg" alt="pokemon-logo"/>
<h1>Pokémon CLI</h1>
<img src="https://img.shields.io/github/v/release/digitalghost-dev/poke-cli?style=flat-square&logo=git&logoColor=FFCC00&label=Release%20Version&labelColor=EEE&color=FFCC00" alt="version-label">
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.7.1?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.7.2?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/ci.yml?branch=main&style=flat-square&logo=github&logoColor=FFCC00&label=CI&labelColor=EEE&color=FFCC00" alt="ci-status-badge">
</div>
<div align="center">
<img src="https://img.shields.io/coderabbit/prs/github/digitalghost-dev/poke-cli?style=flat-square&logo=coderabbit&logoColor=FF570A&labelColor=F6F6F1&color=FF570A" alt="coderabbit-review-count-badge">
</div>
<div align="center">
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/go_test.yml?style=flat-square&logo=go&logoColor=00ADD8&label=Tests&labelColor=EEE&color=00ADD8" alt="tests-label">
<img src="https://img.shields.io/github/go-mod/go-version/digitalghost-dev/poke-cli?style=flat-square&logo=Go&labelColor=EEE&color=00ADD8" alt="go-version"/>
Expand Down Expand Up @@ -91,11 +94,11 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
3. Choose how to interact with the container:
* Run a single command and exit:
```bash
docker run --rm -it digitalghostdev/poke-cli:v1.7.1 <command> [subcommand] flag]
docker run --rm -it digitalghostdev/poke-cli:v1.7.2 <command> [subcommand] flag]
```
* Enter the container and use its shell:
```bash
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.7.1 -c "cd /app && exec sh"
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.7.2 -c "cd /app && exec sh"
# placed into the /app directory, run the program with './poke-cli'
# example: ./poke-cli ability swift-swim
```
Expand Down
25 changes: 25 additions & 0 deletions card_data/infrastructure/aws/ec2/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions card_data/infrastructure/aws/ec2/instance.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "aws_instance" "tfer--i-01dbf82e21c0da38f_dagster-webserver" {
ami = "ami-0326baaa98cf958ed"
instance_type = "t4g.small"
key_name = "dagster-vm-key-pair"
subnet_id = "subnet-04fe6e100221b27d4"
vpc_security_group_ids = ["sg-04c2a30cb05044ad6", "sg-026cc204887184c98"]
ebs_optimized = true
monitoring = false

root_block_device {
delete_on_termination = true
}

tags = {
Name = "dagster-webserver"
}

tags_all = {
Name = "dagster-webserver"
}
}
3 changes: 3 additions & 0 deletions card_data/infrastructure/aws/ec2/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "aws_instance_tfer--i-01dbf82e21c0da38f_dagster-webserver_id" {
value = "${aws_instance.tfer--i-01dbf82e21c0da38f_dagster-webserver.id}"
}
20 changes: 20 additions & 0 deletions card_data/infrastructure/aws/ec2/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
provider "aws" {
region = "us-west-2"
}

terraform {
cloud {
organization = "digitalghost-dev"

workspaces {
project = "poke-cli"
name = "ec2"
}
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.7.0"
}
}
}
6 changes: 3 additions & 3 deletions card_data/infrastructure/aws/rds/db_instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "aws_db_instance" "tfer--dagster-db" {
iam_database_authentication_enabled = "false"
identifier = "dagster-db"
instance_class = "db.t3.micro"
kms_key_id = var.kms-arn-key
kms_key_id = var.kms_arn_key
license_model = "postgresql-license"
maintenance_window = "wed:08:28-wed:08:58"
manage_master_user_password = true
Expand All @@ -32,7 +32,7 @@ resource "aws_db_instance" "tfer--dagster-db" {
option_group_name = "default:postgres-17"
parameter_group_name = "default.postgres17"
performance_insights_enabled = "true"
performance_insights_kms_key_id = var.kms-arn-key
performance_insights_kms_key_id = var.kms_arn_key
performance_insights_retention_period = "7"
port = "5432"
publicly_accessible = "true"
Expand All @@ -50,5 +50,5 @@ resource "aws_db_instance" "tfer--dagster-db" {
}

username = "postgres"
vpc_security_group_ids = ["sg-026cc204887184c98"]
vpc_security_group_ids = ["sg-026cc204887184c98", "sg-09ff0b46e3dd7a843"]
}
5 changes: 4 additions & 1 deletion card_data/infrastructure/aws/rds/db_subnet_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ resource "aws_db_subnet_group" "tfer--poke-cli-db-subnet-group" {
description = "Subnet group for RDS databases"
name = "poke-cli-db-subnet-group"
region = "us-west-2"
subnet_ids = ["subnet-08dae4b7aede93128", "subnet-0eeb519cf23a763bf", "subnet-04fe6e100221b27d4", "subnet-0be3aac807720c1d6"]
subnet_ids = [
"subnet-04fe6e100221b27d4",
"subnet-0be3aac807720c1d6"
]
}
2 changes: 1 addition & 1 deletion card_data/infrastructure/aws/rds/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {

workspaces {
project = "poke-cli"
name = "poke-cli"
name = "rds"
}
}
required_providers {
Expand Down
2 changes: 1 addition & 1 deletion card_data/infrastructure/aws/rds/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable "kms-arn-key" {
variable "kms_arn_key" {
description = "KMS key for RDS"
type = string
sensitive = true
Expand Down
25 changes: 25 additions & 0 deletions card_data/infrastructure/aws/vpc/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions card_data/infrastructure/aws/vpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "aws_vpc_tfer--vpc-0f9d6a37031fa6597_id" {
value = "${aws_vpc.tfer--vpc-0f9d6a37031fa6597.id}"
}
20 changes: 20 additions & 0 deletions card_data/infrastructure/aws/vpc/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
provider "aws" {
region = "us-west-2"
}

terraform {
cloud {
organization = "digitalghost-dev"

workspaces {
project = "poke-cli"
name = "vpc"
}
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.7.0"
}
}
}
19 changes: 19 additions & 0 deletions card_data/infrastructure/aws/vpc/vpc.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resource "aws_vpc" "tfer--vpc-0f9d6a37031fa6597" {
assign_generated_ipv6_cidr_block = "false"
cidr_block = "10.0.0.0/20"
enable_dns_hostnames = "true"
enable_dns_support = "true"
enable_network_address_usage_metrics = "false"
instance_tenancy = "default"
region = "us-west-2"

tags = {
Name = "poke-cli-vpc"
project = "poke-cli"
}

tags_all = {
Name = "poke-cli-vpc"
project = "poke-cli"
}
}
43 changes: 25 additions & 18 deletions card_data/pipelines/definitions.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
from pathlib import Path

from dagster import definitions, load_from_defs_folder
from dagster_dbt import DbtCliResource, DbtProject, dbt_assets

import dagster as dg

from .defs.extract.extract_pricing_data import build_dataframe
from .defs.load.load_pricing_data import load_pricing_data


@definitions
def defs():
return load_from_defs_folder(project_root=Path(__file__).parent.parent)

dbt_project_directory = Path(__file__).absolute().parent / "poke_cli_dbt"
dbt_project = DbtProject(project_dir=dbt_project_directory)

dbt_resource = DbtCliResource(project_dir=dbt_project)

# Compiles the dbt project & allow Dagster to build an asset graph
dbt_project.prepare_if_dev()

# Yields Dagster events streamed from the dbt CLI
@dbt_assets(manifest=dbt_project.manifest_path)
def dbt_models(context: dg.AssetExecutionContext, dbt: DbtCliResource):
yield from dbt.cli(["build"], context=context).stream()

# Dagster object that contains the dbt assets and resource
defs_dbt = dg.Definitions(assets=[dbt_models], resources={"dbt": dbt_resource})
# load_from_defs_folder discovers dbt assets from transform_data.py
folder_defs = load_from_defs_folder(project_root=Path(__file__).parent.parent)
return dg.Definitions.merge(folder_defs, defs_pricing)

# Define the pricing pipeline job that materializes the assets and downstream dbt model
pricing_pipeline_job = dg.define_asset_job(
name="pricing_pipeline_job",
selection=dg.AssetSelection.assets(build_dataframe, load_pricing_data).downstream(include_self=True),
)

price_schedule = dg.ScheduleDefinition(
name="price_schedule",
cron_schedule="31 21 * * *",
target=pricing_pipeline_job,
execution_timezone="America/Los_Angeles",
)

defs_pricing = dg.Definitions(
assets=[build_dataframe, load_pricing_data],
jobs=[pricing_pipeline_job],
schedules=[price_schedule],
)
11 changes: 5 additions & 6 deletions card_data/pipelines/defs/load/load_pricing_data.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import dagster as dg
import polars as pl
from dagster import RetryPolicy, Backoff
from sqlalchemy.exc import OperationalError
from ..extract.extract_pricing_data import build_dataframe
from ...utils.secret_retriever import fetch_secret
from termcolor import colored

from ...utils.secret_retriever import fetch_secret


@dg.asset(
deps=[build_dataframe],
kinds={"Supabase", "Postgres"},
retry_policy=RetryPolicy(max_retries=3, delay=2, backoff=Backoff.EXPONENTIAL),
)
def load_pricing_data() -> None:
def load_pricing_data(build_pricing_dataframe: pl.DataFrame) -> None:
database_url: str = fetch_secret()
table_name: str = "staging.pricing_data"

df = build_dataframe()
try:
df.write_database(
build_pricing_dataframe.write_database(
table_name=table_name, connection=database_url, if_table_exists="replace"
)
print(colored(" ✓", "green"), f"Data loaded into {table_name}")
Expand Down
4 changes: 2 additions & 2 deletions card_data/pipelines/defs/transformation/transform_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ def get_asset_key(self, dbt_resource_props):
manifest=DBT_PROJECT_PATH / "target" / "manifest.json",
dagster_dbt_translator=CustomDbtTranslator()
)
def poke_cli_dbt_assets(context: dg.AssetExecutionContext, dbt: DbtCliResource):
def dbt_load_pricing_data(context: dg.AssetExecutionContext, dbt: DbtCliResource):
"""
dbt assets that transform staging data into final models.
"""
yield from dbt.cli(["build"], context=context).stream()

dbt_resource = DbtCliResource(project_dir=DBT_PROJECT_PATH)
defs = dg.Definitions(
assets=[poke_cli_dbt_assets],
assets=[dbt_load_pricing_data],
resources={"dbt": dbt_resource}
)
2 changes: 1 addition & 1 deletion card_data/pipelines/poke_cli_dbt/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'poke_cli_dbt'
version: '1.7.0'
version: '1.7.2'

profile: 'poke_cli_dbt'

Expand Down
3 changes: 3 additions & 0 deletions card_data/pipelines/poke_cli_dbt/models/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ sources:

- name: pricing_data
description: "Card pricing data"
meta:
dagster:
asset_key: ["load_pricing_data"]
columns:
- name: product_id
description: "Product ID"
Expand Down
16 changes: 14 additions & 2 deletions cmd/pokemon/pokemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,20 @@ func PokemonCommand() (string, error) {
var eggGroupSlice []string

for _, entry := range pokemonSpeciesStruct.EggGroups {
capitalizedEggGroup := cases.Title(language.English).String(entry.Name)
eggGroupSlice = append(eggGroupSlice, capitalizedEggGroup)
modernEggGroupNames := map[string]string{
"indeterminate": "Amorphous",
"ground": "Field",
"humanshape": "Human-Like",
"plant": "Grass",
"no-eggs": "Undiscovered",
}

if name, exists := modernEggGroupNames[entry.Name]; exists {
eggGroupSlice = append(eggGroupSlice, name)
} else {
capitalizedEggGroup := cases.Title(language.English).String(entry.Name)
eggGroupSlice = append(eggGroupSlice, capitalizedEggGroup)
}
}

sort.Strings(eggGroupSlice)
Expand Down
Loading
Loading