Saravanan666/pypi-org huggingface dataset:
Package: ecr-mirror
Docker ECR MirrorMirror public docker images to ECR, automagically. This requiresSkopeoto be installed.pip install ecr-mirrorUsage$ ecr-mirror
Usage: ecr-mirror [OPTIONS] COMMAND [ARGS]...

Options:
  --registry-id TEXT    The registry ID. This is usually your AWS account ID.
  --role-arn TEXT       Assume a specific role to push to AWS
  --override-os TEXT    Specify the OS of images, default to "linux"
  --override-arch TEXT  Specify the ARCH of images, default to "amd64". If set
                        to "all" - all architectures will be synced

  --help                Show this message and exit.

Commands:
  copy        Copy all tags that match a given glob expression into ECR
  list-repos  List all repositories that will be synced
  sync        Copy public images to ECR using ECR tagsCreate an ECR repository with the following two tags set:upstream-imageset to a public Docker hub image, i.enginxoristio/proxyv2upstream-tagsset to a/-separated list of tagglobs, i.e1.6.*or just1.2-alpine. ECR does not allow the
use of the*character in tag values, so you should use+as a replacement.ignore-tagsset to a/-separated list of tagglobsto ignore. ECR does not allow the
use of the*character in tag values, so you should use+as a replacement.Terraform example:resource"aws_ecr_repository""repo"{name="nginx"tags={upstream-image="nginx",// Mirror 1.16* and 1.17*upstream-tags="1.16+/1.17+"ignore-tags="+-gpu"}}Runningecr-mirror syncwill begin concurrently fetching all images and pushing them to ECR.You can runecr-mirror listto see all repositories that will be mirrored.You can also manually copy specific image patterns usingecr-mirror copy:ecr-mirror copy "istio/proxyv2:1.6.*" ACCOUNT_ID.dkr.ecr.eu-west-1.amazonaws.com/istio-proxyv2
Package: ecr-scan-notifier
CDK ECR Scan NotifierA CDK construct capable of forwarding ECR scan results to an SNS topic.Sample EventsECR Basic Scan{"version":"0","id":"822c3bbb-574a-8d0b-828e-b33e93cc0b3a","detail-type":"ECR Image Scan","source":"aws.ecr","account":"012345678912","time":"2022-08-03T18:14:18Z","region":"eu-central-1","resources":["arn:aws:ecr:eu-central-1:012345678912:repository/sampleapp"],"detail":{"scan-status":"COMPLETE","repository-name":"sampleapp","image-digest":"sha256:5b5a96370efd56ae20a832244ae56e8e57b1035f493f728eb6cef026586782f7","image-tags":["3862","latest"],"finding-severity-counts":{"HIGH":3,"MEDIUM":14,"INFORMATIONAL":3,"LOW":1,"HIGH":2}}}AWS Inspector{"version":"0","id":"961d7f4a-f46c-b376-f92f-f8c3af290f9f","detail-type":"Inspector2 Scan","source":"aws.inspector2","account":"520666953574","time":"2022-09-14T19:12:46Z","region":"eu-central-1","resources":["arn:aws:ecr:eu-central-1:520666953574:repository/azure-agent"],"detail":{"scan-status":"INITIAL_SCAN_COMPLETE","repository-name":"arn:aws:ecr:eu-central-1:520666953574:repository/azure-agent","finding-severity-counts":{"CRITICAL":0,"HIGH":1,"MEDIUM":6,"TOTAL":10},"image-digest":"sha256:734a4d019b381f591a63c819ae88b00eed5dba8b76626530c26497128a6c46d1","image-tags":["latest","5715"]}}LinksImage scanning
Package: ecrtools
ecrtoolsecrtools is a small cli for listing ECR repos and searching for images in ECR. Easily print repos and images statsInstallNOTE: Python 3 support only.pip install ecrtoolsExamples$ecrrepos
my-appimages:82untagged:3size:33.9GB
my-app-auto-testsimages:5untagged:0size:2.5GB
....

$ecrimagesmy-appf5f84a52019-03-1914:56:42-07:00438.7MBf5f84a52019-03-1914:56:34-07:00417.2MBawscp-f5f84a5

images:2untagged:0totalsize:0.9GB

$ecrimagesmy-apphead2019-04-0118:14:39-07:00378.3MBrev-source-update,742f07e,head

images:1untagged:0totalsize:0.4GB

$ecrimagesmy-app2019-04-0118:14:39-07:00378.3MBrev-source-update,742f07e,head2019-04-0118:14:31-07:00378.3MBpr-1376
....

images:82untagged:3totalsize:33.9GB
Package: ecs-auditor
ecs-auditor===============:code:`ecs-auditor` handles auditing ECS cluster and services. It also compares SSM param versions against for the same application in different regions.Installation--------------Option 1: :code:`pip install ecs-auditor`Option 2: See `setup.py Usage`_ above for how to use this within setup.py.Usage from sphinx-----------------Run the following command, and pass in any of the :code:`cli parameters` from below::code:`ecs-auditor --config config.yml ...`CLI Parameters------------------------The currently supported cli params are::--config:Specify location of the config file. Must be full location path (use :code:`pwd`):--region:AWS region to get data for. [default: all, options: [us-east-1, eu-central-1, eu-west-1, all] ]:--env:AWS environment to get data for. :code:`preprod,prod,production, etc`:--output:How to display the results. [default: pretty, options: [pretty, json, compare] ]:--ignore-author:Only show the results that do not include this SMS Param author specified:--services:Specify a list of service names in the cluster, separated with a comma. [default: None, options: string']:--show-differences-only:Show only the results where there is a difference either the same application in different regions
Package: ecs_composex
The no-code CDK for docker-compose & AWS ECSDeploy your services to AWS ECS from your docker-compose files in 3 stepsStep 1. Install ECS Compose-xStep 2. Use your existing docker-compose files. Optionally, add Compose-X extensions.Step 3. Deploy to AWS via CloudFormation.What does it do?Automatically deploy applications to AWS using existing docker-compose filesDeploys multiple applications to AWS in a single commandCreates AWS resources such as EC2 Instances, ECS Clusters and ContainersAutomatically configures IAM roles and Networking for secure and reliable accessExpand the definitions with AWS CloudFormation resourcesAllows to use existing resources in your AWS AccountCan be extended with custom modules/hooks to customize the deployment processAutomatically rolls back the application in case of errors, to previous version or to a stable stateUseful LinksDocumentationLabsFeature requestsIssuesCompatibility MatrixInstallation# Inside a python virtual environmentpython3-mvenvvenvsourcevenv/bin/activatepipinstallpip-Upipinstallecs-composex# For your user onlypipinstallecs-composex--userUsage# Get all the optionsecs-compose-x-h# Simple example using docker-compose file and an extension with your AWS Settingsecs-compose-xrender-dtemplates-nmy-new-stack-fdocker-compose.yaml-faws-settings.yaml
Package: ecs-composex-msk-cluster
This package is an extension toECS Compose-Xthat manages Creation of new MSK clusters and automatically links
to services to grant access and permissions.Installpython3-mvenvvenvsourcevenv/bin/activate# With poetrypipinstallpippoetry-Upoetryinstall# Via pippipinstallpip-Upipinstallecs-composex-msk-clusterSyntax Referencex-msk_cluster:Properties:{}Lookup:{}Settings:{}Services:{}Full documentationExamples can be found inuse-casesin this repository.
Package: ecs-connect
ECS ConnectSeamlessly connect to containers running in ECS.RequirementsEC2 BasedFor EC2 based ECS deploymnets, you need SSM Session Manager enabled on the EC2 instances. For enabling SSM Sessions referthis.Make sure you have set proper IAM permissions for the developer going to access containers deployed in EC2 using ecs-connect tool.Fargate BasedFor Fargate based ECS deploymnets, the SSM Session Manager can’t be enabled directly as undelying EC2 instances are managed by AWS. So a Bastion node, an EC2 instances with SSM Session Manager enabled is required. For enabling SSM Sessions referthis.Also, the SSHD must be installed on the container to which you want to connect. And you need to create SSH keys and place them in the container and the bastion node. To setup SSH keys referthis.Make sure you have placed SSH key in bastion node athome/ssm-user/bastion(wherebastionis a key name)Usageecs_connect--profile<profile>--cluster<cluster name>--service<service name>--cmd<init cmd>Exampleecs_connectIf nothing is provided, then config will be pulled from default profile saved in ~/.ecs_connect config file.Optional flags:–profileName of the profile to use in ~/.ecs-connect. If none is provided, then the default profile will be used.–clusterName of the ECS cluster.–serviceName of the service.–taskStarted by name. If provided, the service will be ignored.–cmdInitilization command to run, will be executed once connected to container. If provided, then parameter from profile will be overridden.–allDisplays all running containers, for ECS EC2 based running tasks/services.–verboseMore verbose output.–debugVery verbose output. Useful for debugging.Additional options available in only config file:
*–ssh_userUser name for ssh into fargate based service.
*–ssh_keySSH key path on bastion node.NoteSetcmdtoshorbashdepending on container os to get shell access.<service name> will be used to filter containers.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-03-02)First release on PyPI.1.2.0 (2020-06-10)Added support for referencing task using started by value1.2.3 (2020-09-09)Make task parameter optional for service based deploys2.0.0 (2020-10-22)Add support for selecting aws profile2.0.1 (2021-10-28)Add support for specifying ssh user and path of the ssh key in bastion node3.0.0 (2022-06-29)Add support for ecs exec command3.1.0 (2022-08-11)Add support for interactive mode3.1.1 (2022-08-23)Fix list returns limited results3.1.2 (2022-12-22)Fix exec command when task is given
Package: ecs_connect_cli
aws-ecs-exec-command-cliAWS ECS Exec command cli tool is aimed to :connect to your container instance running under ECS Fargate.tail the log from cloudwatch logs (if you configure a logconfiguration in your task definition)update secret value into secret managerTheaws ecs execute-commandcommand is quite complicated to remember and the tool give you the ability to parse and retrieve:your clustersyour servicesyour tasksyour containerTo let you choose which one you want to connect into.EnhancementsYou can now connect to ECS and tail your logs from an EC2 instance or AWS CloudShell without the need of aws cli and aws credentials file.At start, you are asked what kind of credentials you want to use and which default region.You can now also update your secret directly from the command line.❯python-mecs_connectupdate-secretyour-secret-nameInstallationRequirementsInstall awscli via [https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html] (not necessary if you are connected to an EC2 instance)Install ssm  tools via [https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html]You should install the requirements via the pip install below.Create a virtualenv with python >= 3.9source.venv_3.11.0/bin/activate
pipinstallecs-connect-cliif it is the first time you connect to aws-cli, you have to get credentials key from your aws administrator.Usage❯python-mecs_connect--help


WelcomeinAWSECSExeccommandCli!Usage:ecs_connect[OPTIONS]COMMAND[ARGS]...╭─Options──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│--version-vShowtheapplication'sversionandexit.│
│--install-completionInstallcompletionforthecurrentshell.│
│--show-completionShowcompletionforthecurrentshell,tocopyitorcustomizetheinstallation.│
│--helpShowthismessageandexit.│
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─Commands─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│connectConnecttoanECSFargatecontainer│
│exec-commandExecutemanage.pycommandwithargs│
│list-clusterListclusterintoanAWSaccount│
│list-serviceListservice(s)intoacluster│
│list-taskListtask(s)intoaserviceintoacluster│
│tailTaillogsofaselectedECScontainer│|update-secretUpdatesecretfromsecretmanager|╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯Thanks to Typer from@tiangoloThanks to@kraymerfor echoprompt :sunglasses:
Package: ecs-consul-reg
ecs consul regDocker container registration for Consul on AWS ECS.You may want to useregistratorinstead.
Main differences:python based (If I was comfortable with Golang I would probably just contribute to registrator instead)intended to be run on ec2 not within dockerkeeps detailed logs (json file)Uses Docker Health instead of running it's own checks@seegliderlabs:issues/578Install on Amazon ECS-Optimized Amazon Linux AMI 2Pip is not installed:curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.pyInstallpip install ecs-consul-regRunecs-consul-regInitctl scripttodo~OptionsCONSUL_HOST=127.0.0.1
CONSUL_PORT=8500Options can be supplied as env or in yaml config.Usage: main.py [OPTIONS]

Options:
  -c, --config TEXT
  -lf, --logfile TEXT
  -ll, --loglevel TEXT
  --help                Show this message and exit.
Package: ecs-container-exporter
ecs-container-exporterAWS ECSside car that exports ECS container level docker stats metrics toPrometheusas well as publish it via Statsd.MotivationThe default metrics available in AWS ECS are limited, mostly at the task level, across all containers in a task; the container level metrics are not available. In addition, more detailed cgroup metrics are also not available, such as per cpu, and memory usage breakdown into cache, rss, etc.Luckily AWS exposes thedocker statsdata via aTask metadata endpoint.The ecs-container-exporter parses this data, and can expose it to Prometheus or push them via StatsD.UsageInstall via Pip:$ pip3 install ecs-container-exporteror via docker:$ docker pull raags/ecs-container-exporterOn ECS, add the following json to the task definition:{"name":"ecs-container-exporter","image":"raags/ecs-container-exporter:latest","portMappings":[{"hostPort":0,"protocol":"tcp","containerPort":9545}],"command":[],"cpu":256,"dockerLabels":{"PROMETHEUS_EXPORTER_PORT":"9545"}}ThePROMETHEUS_EXPORTER_PORTlabel is for ECS discovery viahttps://github.com/teralytics/prometheus-ecs-discoveryTo include or exclude application containers use theINCLUDEorEXCLUDEenvironment variable. By defaultecs-container-exporterand~internal~ecs~pause(a Fargate internal sidecar) is excluded.StatsdVersion2.0.0add Statsd support with--use-statsdflag or envUSE_STATSD. Metrics are emitted with DogStatsd Tag format.MetricsThe metrics are sampled twice as per the configuredinterval(default 60s), and than aggregated in this interval. This should be set to the Prometheus scrape interval.CPUCPU usage ratio is calculated and scaled as per the applicable container or task cpu limit:Task LimitContainer LimitTask MetricContainer Metric00no scalingno scaling0xno scalingscale cpu (can burst above 100%)x0scale as per limitscale as per task limitxxscale as per limitscale as per container limit (can burst above 100%)Note that unlikedocker statscommand and others, CPU usage is not scaled to
the number of CPUs. This means a task with 4 CPUs with all 4 having full
utilization will show up as 400% indocker stats, but 100% here.MemoryMemory usage and cache is emitted separately, but the memory usage also includes cache, so
subtract cache from it to plot application memory usage specifically.IONetworkNetwork metrics were recently added in Fargate 1.4.0 and ECS agent 1.41.0 onwards.TODO[] - Support Non ECS docker host containers
Package: ecsctl
kubectl-style command line tool for AWS EC2 Container Service (ECS)InstallationpipinstallecsctlPurposeA convenient command line tool to view ECS cluster status and do
troubleshooting.This tool is trying to provide similar functionality ofkubectlfor
kubernetes.Of course, ECS and kubernetes are so different. Many features on
kubernetes are not possible here in ECS.Some AWS official projects to check out:ecs-cliaws-cli ecs
commandUsageClusterList nodes:% ecsctl get clusters
NAME     STATUS      RUNNING    PENDING    INSTANCE COUNT
default  ACTIVE            3          0                 2Get cluster details:% ecsctl describe cluster myclusterCreate/delete cluster:% ecsctl create cluster myclusterContainer Instances (nodes)List nodes:% ecsctl get nodes --cluster mycluster
INSTANCE ID                           EC2 INSTANCE ID      STATUS      RUNNING COUNT
00000000-1111-2222-3333-444444444444  i-abcdef123456abcde  ACTIVE                  1Get node detail:% ecsctl describe node 00000000-1111-2222-3333-444444444444Drain/undrain node:% ecsctl drain 00000000-1111-2222-3333-444444444444ServicesList services:% ecsctl get servicesList services in certain order:% ecsctl get services --sort-by "createdAt"Delete a service:% ecsctl delete service badserviceDelete a service (even if it has desiredCount > 0):% ecsctl delete service badservice --forceRun container quick start% ecsctl run mycontainer --image busybox
mycontainer

% ecsctl get services
NAME             TASK DEFINITION      DESIRED    RUNNING  STATUS    AGE
mycontainer-svc  mycontainer:1              1          0  ACTIVE    10 seconds agoRun docker exec on containers (Requires customizing docker daemon to listen on internal addresses)% ecsctl get tasks
TASK ID                               STATUS    TASK DEFINITION    AGE
42f052c4-80e9-411d-bea2-407b0b4a4b0b  PENDING   mycontainer:1      2 minutes ago

% ecsctl exec 42f052c4-80e9-411d-bea2-407b0b4a4b0b date
Fri May 26 00:13:24 PDT 2017

% ecsctl exec -it 42f052c4-80e9-411d-bea2-407b0b4a4b0b /bin/bash
root@container:/# (interactive)Configure docker daemon to allowecsctl execLet docker daemon listen on TCP ports (required)Add options like-Htcp://0.0.0.0:MYDOCKERPORTor environment
variableDOCKER_HOST=tcp://0.0.0.0:MYDOCKERPORTto configure docker
daemon. Seedockerd
documentationfor more information.Security enhancement: dropping traffic from ECS containers to docker
daemon.iptables --insert INPUT 1 \
         --in-interface docker+ \
         --protocol tcp \
         --destination-port MYDOCKERPORT \
         --jump DROPConfigsSet default cluster name (equivalent to--clusteroption)% ecsctl config set cluster myclusterSet default docker daemon port% ecsctl config set docker_port 2375
Package: ecs-deplojo
Deployment tool for Amazon ECS.Installationpip install ecs-deplojoUsageUsage: ecs-deplojo [OPTIONS]

Options:
  --config FILENAME   [required]
  --var VAR
  --dry-run
  --output-path PATH
  --role-arn <optional arn>
  --help              Show this message and exit.Example configuration---cluster_name:exampleenvironment:DATABASE_URL:postgresql://task_definitions:web:template:task_definitions/web.jsonoverrides:uwsgi:memory:512portMappings:-hostPort:0containerPort:8080protocol:tcpmanage:template:task_definitions/manage.jsonservices:web:task_definition:webbefore_deploy:-task_definition:managecontainer:uwsgicommand:manage.py migrate --noinputafter_deploy:-task_definition:managecontainer:uwsgicommand:manage.py clearsessionsUsing SSM secretsWhen you want to use the AWS SSM secrets in your configuration you can use thesecretssection, however this needs some additional configuration within AWSAt first you need an AWS IAM role to use as the ECS execution role, this role needs
access to the secrets in Secrets Manager or Parameter store and will only be used during
the startup of your Docker container.Example configuration:--cluster_name:exampleenvironment:NORMAL_ENV_VAR:value_of_variablesecrets:DATABASE_URL:/path/to/secret/DATABASE_URLtask_definitions:web:execution_role_arn:arn:aws:iam::<account_id>:role/execution_role_nametemplate:task_definitions/web.jsonservices:web:task_definition:webWhen the container is started the secrets are available as environment variables and
hidden in the AWS ECS console.AWS Default VPCWhen running your servers in the AWS default VPC you neednetworkMode="awsvpc"in
your task definition JSON file, this will ensure that no hostnames are set for the
containers, since this isn’t supported by AWS.AWS FargateUnlike EC2 based clusters AWS Fargate needs aexecution_role_arnto work, this can be
set in your service definition in the YAML file.Example log outputStarting deploy on cluster example (1 services)
Registered new task definition web:10
Starting one-off task 'manage.py migrate --noinput' via manage:10 (uwsgi)
Updating service web with task defintion web:10
Waiting for deployments
Waiting for services: web (0/2)
Waiting for services: web (1/2)
Waiting for services: web (2/2)
Deployment finished: web (2/2)
Starting one-off task 'manage.py clearsessions' via manage:10 (uwsgi)
Package: ecs-dns
ECS DNS v0.1.13Creates a Route 53 multi-value A record for ECS tasks using the appropriate public IP (default) or private IP (fallback when no public IP exists).FeaturesCreate a new A record in a multi-value setUsagepip install ecs-dns
ecs-dns --helpCreditsShaun Martin (inhumantsar)inhumantsar@protonmail.com
Package: ecs-exec
ecs-execpip installable bin to allow user to exec commands inside containers running onAWS ECS Fargatethat relies onterraformedinfrastructure.MotivationRun commands inside containers defined by terraform on AWS ECS Fargate.Installation$pipinstallecs-execUsageAt minimum a terraform module which will output the following:output"cluster_id"{value="${var.cluster_id}"}output"main_task_arn"{value="${var.main_task_arn}"}cluster_idis used to identify the ECS cluster, andmain_task_arnis used to identify the main task in the ECS cluster. This also assumes that you have configured the following to allow ECS exec:ECS clusterECS taskAWS userOnce you have applied the terraform configuration, pull the output into json:$terraformoutput-jsoncustom_ecs_service>custom_ecs_service.jsonNow you can run your command inside a specific containerAWS_PROFILE=stagingecs-exec--filecustom_ecs_service.json--containerphp-fpm--commandbashIf you do not know the container name upfront then not supplying the container will print out valid container names.OutputOutput will look something like:AWS_PROFILE=stagingecs-exec--filecustom_ecs_service.json--containerphp-fpm--command"date +%F"TheSessionManagerpluginwasinstalledsuccessfully.UsetheAWSCLItostartasession.


StartingsessionwithSessionId:ecs-execute-command-qNq9bIy0uTrZlriS
ThissessionisencryptedusingAWSKMS.2021-06-25


ExitingsessionwithsessionId:ecs-execute-command-qNq9bIy0uTrZlriS.