Skip to content
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

Support for Caching feature in Azure Container Registry(ACR) #21258

Closed
1 task done
abilous-ti opened this issue Apr 3, 2023 · 22 comments · Fixed by #26034
Closed
1 task done

Support for Caching feature in Azure Container Registry(ACR) #21258

abilous-ti opened this issue Apr 3, 2023 · 22 comments · Fixed by #26034

Comments

@abilous-ti
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Caching for ACR allows you to create a cache rule and cache container images from Docker Hub and Microsoft Artifact Registry. Caching images lets you pull images directly from your cache ensuring faster and more reliable pull operations.

New or Affected Resource(s)/Data Source(s)

azurerm_container_registry

Potential Terraform Configuration

resource "azurerm_container_registry" "acr" {
  name                = "containerRegistry1"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  sku                 = "Premium"
  admin_enabled       = false
  georeplications {
    location                = "East US"
    zone_redundancy_enabled = true
    tags                    = {}
  }
  cache_rule {
    name                    = "name"
    registry                = "registry"
    source-repo             = "source-repo"
    target-repo             = "target-repo"
  }
  georeplications {
    location                = "North Europe"
    zone_redundancy_enabled = true
    tags                    = {}
  }
}

References

https://aka.ms/acr/cache

@neko1101
Copy link

neko1101 commented Jul 4, 2023

Hey guys,

any update on this, we hit the dockerhub rate limit lately..

@nclaeys
Copy link

nclaeys commented Jul 13, 2023

I want to try implementing this as we also need it. Before starting however, we the go-azure-sdk needs to support the latest containerRegistry api (2023-01-01-preview), which includes support for caching.

@nclaeys
Copy link

nclaeys commented Aug 25, 2023

Since yesterday the go-azure-sdk supports apiversion 2023-07-01 of the containerregistry api, which has support for cacherules. Now the functionality can be implemented in the terraform provider. I am not sure when I will find time to start on it, so if someone else wants to give it a go, be my guest. More details can be found here

@bkarakashev
Copy link

@tombuildsstuff he ACR Cache rules are not our of preview and in production. Are you able to add support for it in terraform?
Many thanks

@kevinharing
Copy link

We're longing for this as well, by September 30 new dockerhub rate limiting will come into effect and this would make things easier to manage.

@kevinharing
Copy link

It's now GA.

@JoachimHansEDDI
Copy link

Hi there

Did you find some time to work on it? @nclaeys

@nclaeys
Copy link

nclaeys commented Nov 7, 2023

@JoachimHansEDDI I did not get to it yet. Feel free to take it over, I am a bit swamped with other work in the coming weeks.

@JoachimHansEDDI
Copy link

@JoachimHansEDDI I did not get to it yet. Feel free to take it over, I am a bit swamped with other work in the coming weeks.

I have no clue about development. ;-)

@bkarakashev
Copy link

Please, any update on this?

@webstean
Copy link

Any update, currently a BIG gap in azurerm support IMHO

@mhaligowski
Copy link
Contributor

I'm an independent contributor, started working on it!

@JoachimHansEDDI
Copy link

I'm an independent contributor, started working on it!

Thanks a lot @mhaligowski

@JoachimHansEDDI
Copy link

Morning @mhaligowski

I see your PR https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform-provider-azurerm%2Fissues%2F21258

What/Who is the showstopper here or how is the process to get this merged?

@mhaligowski
Copy link
Contributor

@JoachimHansEDDI evening, I'm still working on it! I think core of the development is done, I was able to run some base tests. The things left are:

  • optional credentials,
  • tests.

I've been busy with my professional project, which actually requires this change! I hope to get it finished within the next two weeks, with some more spotty people's availability over the holidays.

Sorry if this is putting you in an inconvenient position, I'm working on it in my spare time.

@JoachimHansEDDI
Copy link

Hi @mhaligowski

Did you find any time to push that forward?

@janlauber-swissgrid

This comment was marked as off-topic.

@ashwajce

This comment was marked as off-topic.

@nguyenhung1121990
Copy link

There is currently looking that not supported by terraform yet. However I am using azapi terraform functions and it works.

MS Docs: https://learn.microsoft.com/en-us/azure/templates/microsoft.containerregistry/2023-01-01-preview/registries/cacherules?pivots=deployment-language-terraform

@danvy
Copy link

danvy commented May 16, 2024

It's been a year since this feature was introduced 🎂

@npk-amperon
Copy link
Contributor

npk-amperon commented May 21, 2024

Heads-up that I've springboarded off @mhaligowski's work and have a PR ready for review. I've run the acceptance tests locally (and built the provider and poked around manually). Everything seems to work.

Copy link

github-actions bot commented Jul 1, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.