8000 GitHub - jetersen/ecr-browser
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jetersen/ecr-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECR Browser

Overview

ECR Browser is a .NET 9 application designed to provide a user-friendly interface for browsing and managing container images stored in Amazon Elastic Container Registry (ECR). It consists of a Blazor-based frontend and a .NET backend for interacting with the AWS ECR service.

Key Features

  • Browse ECR Repositories: List and view container image repositories within your AWS account.
  • View Image Details: Display detailed information about each image, including digest, tags, push date, pull date, and size.
  • Filtering and Sorting: Filter images based on age, the number of images in a repository, and sort by pull date or size.
  • Batch Image Deletion: Select and delete multiple images at once from your ECR repositories.
  • Clipboard Integration: Easily copy image digests to the clipboard.
  • Asynchronous Operations: Utilizes asynchronous operations for efficient data retrieval and management.
  • Caching: Implements caching to improve performance and reduce API calls to AWS ECR.
  • UI using MudBlazor: Modern and responsive UI components.
  • Aspire Integration: Uses Aspire to orchestrate the application and its dependencies.

Architecture

The application follows a multi-project structure:

Components

How It Works

  1. Data Retrieval: The RepositoriesPage component calls the GetImagesAsync method in the EcrService to retrieve image data.
  2. Caching: The EcrService uses IFusionCache to cache the image data. If the data is not in the cache, it calls the GetImagesInnerAsync method to fetch the data from ECR.
  3. ECR Interaction: The GetImagesInnerAsync method uses the EcrClient to interact with the AWS ECR API. It retrieves a list of repositories and then retrieves the images for each repository.
  4. Data Transformation: The EcrClient transforms the data received from the AWS ECR API into ImageDetailsDto objects using the ToDto extension method.
  5. Data Display: The RepositoriesPage component displays the image data in a MudTable component, allowing users to sort, filter, and select images for deletion.
  6. Image Deletion: When the user selects images for deletion, the RemoveImagesAsync method is called. This method groups the selected images by repository, creates EcrBatchDelete objects, and calls the RemoveImageAsync method in the EcrService to delete the images from ECR.
  7. Local Cache Update: After deleting the images from ECR, the RemoveLocalImages method is called to update the local cache.

Prerequisites

  • .NET 9 SDK
  • AWS Account
  • AWS IAM Role with appropriate credentials to access ECR
  • Docker (if running locally)

Getting Started

  1. Clone the repository:

    git clone https://github.com/jetersen/ecr-browser.git
    cd ecr-browser
  2. Configure AWS Credentials:

    Ensure your AWS credentials are configured correctly. The application uses the AWS SDK for .NET, which supports various methods for configuring credentials, including environment variables, shared credentials files, and IAM roles.

  3. Run the application:

    Navigate to the Ecr.Browser.AppHost directory and run the application using the following command:

    dotnet run

    This will start the application and its dependencies, including Redis.

  4. Access the UI:

    Open your web browser and navigate to the URL displayed in the console output (typically https://localhost:7148).

Configuration

The application can be configured using environment variables and appsettings.json files.

AWS Configuration

The AWS SDK for .NET uses the standard AWS configuration methods. You can configure the AWS region and credentials using environment variables, shared credentials files, or IAM roles.

Caching Configuration

6F2E The caching behavior is configured in the EcrService. The FusionCacheEntryOptions class is used to configure the cache duration and other options.

OpenTelemetry Configuration

The application uses OpenTelemetry for tracing and metrics. The OpenTelemetry endpoint can be configured using the OTEL_EXPORTER_OTLP_ENDPOINT environment variable.

Contributing

Contributions are welcome! Please submit a pull request with your changes.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published
0