I had to go full Rube Goldberg to clean up old image tags from closed PRs, while still leaving deletion of untagged image to the ECR repo's own lifecycle policy. Never go full Rube Goldberg:
name: ECR Retention Policy
on:
pull_request:
types:
- closed
workflow_call:
workflow_dispatch:
jobs:
clean-unused-ecr:
name: Delete unused container images
runs-on: runs-on,runner=2cpu-linux-x64,run-id=${{ github.run_id }},image=ecr_login_image
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.RUNS_ON_AWS_REGION }}
- name: AWS ECR Login
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: AWS ECR Info
shell: bash
run: |
echo "ECR_REGISTRY=${{ steps.login-ecr.outputs.registry }}" >> $GITHUB_ENV
echo "ECR_REPO=$(basename ${{ github.repository }})" >> $GITHUB_ENV
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPO }}
flavor: suffix=-
tags: type=raw,value=${{ github.head_ref || github.ref_name }}
# NOTE: This is convoluted because AWS ECR has no simple way to untag image without deletion
# given we want to leave deletion of untagged image to the ECR repo's own lifecycle policy
# https://stackoverflow.com/questions/70065254/remove-ecr-image-tag-despite-imagereferencedbymanifestlist-error
# https://github.com/aws/containers-roadmap/issues/1567
- name: AWS ECR Cleanup
shell: bash
run: |
REPO_EXISTS=$(aws ecr describe-repositories --repository-names $ECR_REPO 2>&1 || true)
if echo "${REPO_EXISTS}" | grep -q 'RepositoryNotFoundException'; then
echo "Repository not found, skipping cleanup."
exit 0
fi
IMAGE_TAGS=$(aws ecr list-images --repository-name $ECR_REPO --query 'imageIds[*].imageTag' --output text)
docker pull busybox
docker tag busybox $ECR_REGISTRY/$ECR_REPO:_
docker push $ECR_REGISTRY/$ECR_REPO:_
TEMP_IMAGE=$(
aws ecr batch-get-image \
--repository-name $ECR_REPO \
--image-ids imageTag=_ )
TEMP_MANIFEST=$(echo $TEMP_IMAGE | jq -r '.images[].imageManifest')
TEMP_DIGEST=$(echo $TEMP_IMAGE | jq -r '.images[].imageId.imageDigest')
TAG_PREFIX=$(echo ${{ fromJSON(steps.docker_meta.outputs.json).tags[0] }} | cut -d: -f2)
for TAG in $IMAGE_TAGS
do
if [[ $TAG == $TAG_PREFIX* ]]; then
docker tag busybox $ECR_REGISTRY/$ECR_REPO:$TAG
docker push $ECR_REGISTRY/$ECR_REPO:$TAG
echo "Untaged image $TAG"
fi
done
# Delete the temporary image by digest
aws ecr batch-delete-image \
--repository-name $ECR_REPO \
--image-ids imageDigest=$TEMP_DIGEST
Looks like Moonlight does have their app up on the Apple store or iOS, and Sunlight has binaries for most operating systems. Personally, instead of Sunlight's server, I still use Nvidia's GeForce Experience software to stream games, as it takes less effort to configure. Of course, Nvidia may not be applicable if you're using integrated or AMD graphics instead.
Although, with Nvidia recently deprecating support for it's shield device, Sunlight provides support for the same protocol that Moonlight was originally developed against, but it's also open source. I've not used multi monitor streaming with GeForce Experience, something Sunlight would be much more flexible in configuring.
As for connectivity, I'm unsure if iOS supports the same USB network feature that Android has. I'd imagine at least the iPhone would, as that's a core feature/option for mobile hotspot connectivity, but maybe that's nixed from iPad iOS? Alternatively you could get yourself a USB C hub or dock with an ethernet adapter and pass through power delivery, so you can connect your iPad with a wired network and charge simultaneously.
Or you could just use Wi-Fi, but with wireless networks dropping and retrying packets, that'll impact latency or bitrate quality when casting displays. Although for something mostly static like discord windows, that's probably less of an issue. Windows 11, and maybe 10, also have a hotspot mode, where you could share your wired network via your PCs wireless radio via and ad hoc Wi-Fi SSID. That could reduce latency and improve signal reception, but you'd have to start the hotspot setting every session or whenever the device disconnects from windows' hotspot for more than 15 minutes or something.
You could try other remote display streaming software as well, like Parsec. However they have a online account login requirement with the freemium model, so I prefer the open source client Moonlight instead. However parsecs a lot easier too use when streaming from outside your home, or when remotely single screen co-oping with friends, without having to configure firewalls or domain names.