Comments (38)
Also this link provides the details on the ARM spec for ACR: https://docs.microsoft.com/en-us/azure/templates/microsoft.containerregistry/2017-10-01/registries
from farmer.
@JordanMarr I have the following working. What features are you using?
I am guessing linking Identity is a must. Tasks? Encryption? Geo-replication?
open Farmer
open Farmer.Resources.ContainerRegistry
let myRegistry = containerRegistry {
name "devonRegistry"
sku Basic
enable_admin_user
}
let deployment = arm {
location WestEurope
add_resource myRegistry
output "registry" myRegistry.Name
}
deployment
|> Deploy.execute "FarmerTest" Deploy.NoParameters
@isaacabraham How do you usually handle a feature? Should I prefer to releasing a minimal set of features and increment, or aim for feature-complete?
from farmer.
Opened a PR for review and comments #129
from farmer.
@isaacabraham I changed my tests over to Expecto. Hopefully, IntelliJ pulls through and delivers support for Expecto tests in the 2020.2 Rider release.
Please let me know if anything else. I will take a quick look at how updating the docs is done.
from farmer.
Not as far as I know - @ninjarobot do you have any plans for this?
from farmer.
@dburriss I think @forki also has some interest in this and we might be adding it to web apps shortly.
from farmer.
Here's how it's looking at the moment...
let myDockerApp = webApp {
name "isaacssuperapp"
app_insights_off
docker_image "myImage" "startup.dll"
docker_ci
docker_registry_credentials "www.myuri.com" "userisaac"
}
Generates the following ARM template:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"docker-password-for-isaacssuperapp": {
"type": "securestring"
}
},
"resources": [
{
"apiVersion": "2016-08-01",
"dependsOn": [
"isaacssuperapp-plan"
],
"kind": "app,linux,container",
"location": "northeurope",
"name": "isaacssuperapp",
"properties": {
"httpsOnly": false,
"serverFarmId": "isaacssuperapp-plan",
"siteConfig": {
"alwaysOn": false,
"appCommandLine": "startup.dll",
"appSettings": [
{
"name": "DOCKER_ENABLE_CI",
"value": "true"
},
{
"name": "DOCKER_REGISTRY_SERVER_PASSWORD",
"value": "[parameters('docker-password-for-isaacssuperapp')]"
},
{
"name": "DOCKER_REGISTRY_SERVER_URL",
"value": "www.myuri.com"
},
{
"name": "DOCKER_REGISTRY_SERVER_USERNAME",
"value": "userisaac"
}
],
"linuxFxVersion": "DOCKER|myImage",
"metadata": []
}
},
"type": "Microsoft.Web/sites"
},
{
"apiVersion": "2018-02-01",
"kind": "linux",
"location": "northeurope",
"name": "isaacssuperapp-plan",
"properties": {
"name": "isaacssuperapp-plan",
"perSiteScaling": false,
"reserved": true
},
"sku": {
"capacity": 1,
"name": "F1",
"size": "0",
"tier": "Free"
},
"type": "Microsoft.Web/serverfarms"
}
]
}
Does this look about right?
@forki Please note that you don't specify the password with this approach. Instead, Farmer creates a secure parameter which is passed in at deployment time i.e. when you deploy the template. So this could be passed in by your CI system as an environment variable or whatever.
from farmer.
from farmer.
@forki that's what I asked you recently - I thought you said that you had tried it and it magically just worked :-)
from farmer.
Unless you're referring to the registry credentials url?
from farmer.
Not magically. Only with the properties that I sent you in the private gist
from farmer.
@forki those are all in the above code snippet?
from farmer.
ok just saw it's the first param of docker_registry_credentials
?
Farmer creates a secure parameter which is passed in at deployment time i.e. when you deploy the template
how do I set it?
from farmer.
You supply the URL and username at compile time into the Farmer builder (per the example).
The password you have to supply at the runtimetime when calling Deploy.execute
. I just realised that in the migration from the REST option, we've dropped that off. Let me add it back in...
from farmer.
;-)
from farmer.
Released in 0.11.
let myVm = vm {
name "isaacssupervm"
username "isaacadmin"
}
let template = arm {
location NorthEurope
add_resource myVm
}
template
|> Deploy.execute "my-resource-group-name" [ "password-for-isaacssupervm", "bladebla" ]
from farmer.
is the docker_ci setting also released? computer says no
from farmer.
I don't see it in the builder. @isaacabraham seems like a classic "works on my machine" :P
from farmer.
Sorry. I was referring to the password bit being release. The Docker stuff not yet - I have literally not tested it at all. Can you test locally from the branch?
from farmer.
or provide me with some suitable registry settings :-)
from farmer.
you can test it with the docker hub settings for bookstore
from farmer.
The Docker Hub image doesn't need the registry credentials bit - that's the new bit (along with the CI setting). That's just the docker_image
setting which is already tested.
from farmer.
I'm also interested in creating Azure Container Registry and Container Instances.
Is this still a no, or maybe a maybe? :)
from farmer.
@JordanMarr definitely yes! ACR is probably a good one to start with as well - here's a sample I found on the official samples github repo: https://github.com/Azure/azure-quickstart-templates/blob/master/101-container-registry/azuredeploy.json.
Happy to provide you to some help as needed.
This would fit nicely with the work that was released this weekend for ACR support in webapps - in the future we could tie them together even more closely so e.g. you create an ACR instance, create a web app, and link the two directly in Farmer.
from farmer.
@JordanMarr let me know if you are going to pick this up. If not I will. I didn't hear back on whether this work was already started but it sounds like it has not.
from farmer.
@JordanMarr note - when you say "container instances" what do you mean? If you just mean linux app service that use ACR or Docker Hub, then this is already supported. We also have support for Container Groups (although this has not been documented on the site).
from farmer.
@JordanMarr note - when you say "container instances" what do you mean? If you just mean linux app service that use ACR or Docker Hub, then this is already supported. We also have support for Container Groups (although this has not been documented on the site).
Ahh, very nice! I think Container Group is actually what I need.
from farmer.
@JordanMarr let me know if you are going to pick this up. If not I will. I didn't hear back on whether this work was already started but it sounds like it has not.
Trust that no work here has happened here. :)
Please proceed!
from farmer.
@JordanMarr in lieu of it being in the documentation, there is an example in a PR for some tests that shows creating a container group with a single container. I need to revisit with @isaacabraham about what is needed to include this sort of test or if I should do something more to include it in docs. Please let me know if there are some features you would find helpful and they should be easy enough to add.
from farmer.
@isaacabraham @ninjarobot I would like to take a stab at getting started on this over the weekend. I did look through the builders when I initially asked this question. I may have questions :)
Target:
https://docs.microsoft.com/en-us/azure/templates/microsoft.containerregistry/2017-10-01/registries
from farmer.
@ninjarobot I'm going to review and get that merged in. Apologies for pushing it to the back.
from farmer.
@dburriss no worries! This is an example of Cognitive Services which is a pretty simple one - you might want to try to follow that one through.
We could also add some technical documentation on how to create new builders / resources.
from farmer.
@isaacabraham thanks. Let me give it a go and I will make notes of what is not clear to feed into any needed docs.
from farmer.
I think you have already ticked all the basic features that I'm using so far in development.
from farmer.
@dburriss my approach has been to do the 20% of functionality that solves 80% of what people want i.e. start simple, release it, and see if anyone complains :-) New features can always be added afterwards without too much work, and I found starting up-front and trying to do everything just over complicates things.
from farmer.
@dburriss one thing that we will probably look at over time is the ability to create a web app and seamlessly connect it to the ACR - so pulling the admin username and password from the ACR resource into the web app as an expression. For now, that's not needed though!
from farmer.
@isaacabraham addressed the review comment.
I also took at stab at supporting custom storageAccount. That led to noticing a 'Classic' SKU which it turns out is no longer supported. So it turns out a bunch of the additional functionality on ACR is no longer supported.
So the only feature to enable if we wanted to would be Encryption. This can wait for sure till someone requests it.
let deployment = arm {
location NorthEurope
add_resource myRegistry
output "registry" myRegistry.Name
output "loginServer" (sprintf "[reference(resourceId('Microsoft.ContainerRegistry/registries', '%s'),'2019-05-01').loginServer]" myRegistry.Name.Value)
}
I did want to ask about how to handle outputs from a resource. Was thinking myRegistry.Outputs.LoginServer
? I imagine I will need these to get the login details. I think returning these needs to be optional.
from farmer.
@dburriss I think just create a member on the config object called LoginServer which does the string splicing, similar to how Key
works on StorageAccountConfig
etc. Then you can just do the following:
let deployment = arm {
location NorthEurope
add_resource myRegistry
output "registry" myRegistry.Name
output "loginServer" myRegistry.LoginServer
from farmer.
Related Issues (20)
- Add option to set DAPR protocol for Container Apps HOT 1
- Event Hub as dependency is invalid HOT 4
- Get existing project running
- Seems as if remote vnet peering for virtual networks does not support the remote vnet being in a different resource group HOT 1
- Deploying a function app overwrites the WEBSITE_CONTENTSHARE value HOT 1
- SQL Server Builder - Create System Assigned Identity HOT 3
- CosmosDB Gremlin support HOT 3
- P0V3 app service type is missing
- Add SupportsHttpsTrafficOnly property support for storage accounts
- Tests failing in CICD HOT 2
- Service Bus builder needs validation improvements
- Alert dependable on Action Group HOT 2
- App Service does not support Linux App Insights automatic instrumentation
- Upgrade to Fantomas 6
- No builder support for adding subnet per IP of LoadBalancer backendAddressPool
- PostgreSQL dependency generates incorrect path
- Details about associating web app to vnet HOT 8
- Migrate to PostgreSQL Flexible Database
- Migrate Web App to use Log Analytics + App Insights
- Dependabot update for System.Text.Json forces a library update on Farmer consumers HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from farmer.