-
Notifications
You must be signed in to change notification settings - Fork 10
Reimplement infrastructure with EKS #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| name: Launch application | ||
| on: | ||
| schedule: | ||
| - cron: '0 13 * * 1,2,3,4,5' # launch at 8:00 AM EST | ||
| jobs: | ||
| launch_application: | ||
| name: Launch application on weekday schedule | ||
| runs-on: ubuntu-latest | ||
| environment: pulumi | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Install Flox | ||
| uses: flox/install-flox-action@v2 | ||
| - name: Deploy with Pulumi | ||
| uses: flox/activate-action@v1 | ||
| env: | ||
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
| with: | ||
| command: mise tasks run infrastructure:up |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| name: Teardown application | ||
| on: | ||
| schedule: | ||
| - cron: '0 23 * * 1,2,3,4,5' # teardown at 6:00 PM EST | ||
| jobs: | ||
| teardown_application: | ||
| name: Teardown application on weekday schedule | ||
| if: github.event.schedule == '0 23 * * 1,2,3,4,5' | ||
| runs-on: ubuntu-latest | ||
| environment: pulumi | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Install Flox | ||
| uses: flox/install-flox-action@v2 | ||
| - name: Dismantle with Pulumi | ||
| uses: flox/activate-action@v1 | ||
| env: | ||
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
| with: | ||
| command: mise tasks run infrastructure:down |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,4 @@ infrastructure/Pulumi.production.yaml | |
| .coverage* | ||
| .coverage/ | ||
| coverage.xml | ||
| infrastructure/kubeconfig.json | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| from typing import cast | ||
|
|
||
| import boto3 | ||
| from polygon import RESTClient | ||
| from polygon.rest.models.aggs import GroupedDailyAgg | ||
|
|
||
|
|
||
| class PolygonClient: | ||
| def __init__(self, polygon_api_key: str) -> None: | ||
| self.polygon_client = RESTClient(api_key=polygon_api_key) | ||
|
|
||
| def get_all_equity_bars(self, date: str) -> list[GroupedDailyAgg]: | ||
| grouped = self.polygon_client.get_grouped_daily_aggs( | ||
| date=date, | ||
| adjusted=True, | ||
| ) | ||
|
|
||
| return cast("list[GroupedDailyAgg]", grouped) | ||
|
|
||
|
|
||
| class S3Client: | ||
| def __init__(self, data_bucket_name: str) -> None: | ||
| self.s3_client = boto3.client("s3") | ||
| self.data_bucket_name = data_bucket_name | ||
| self.daily_equity_bars_path = f"s3://{self.data_bucket_name}/equity/bars/" | ||
|
|
||
| def list_objects(self, prefix: str = "") -> list[str]: | ||
| objects = [] | ||
| paginator = self.s3_client.get_paginator("list_objects_v2") | ||
|
|
||
| for page in paginator.paginate(Bucket=self.data_bucket_name, Prefix=prefix): | ||
| if "Contents" in page: | ||
| objects.extend([obj["Key"] for obj in page["Contents"]]) | ||
|
|
||
| return objects | ||
|
|
||
| def delete_objects(self, object_names: list[str]) -> None: | ||
| if not object_names: | ||
| return | ||
|
|
||
| delete_requests = [{"Key": obj} for obj in object_names] | ||
| self.s3_client.delete_objects( | ||
| Bucket=self.data_bucket_name, | ||
| Delete={"Objects": delete_requests}, | ||
| ) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.