Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Design doc for spk service create #480

Merged
merged 19 commits into from
Apr 6, 2020
Merged

Design doc for spk service create #480

merged 19 commits into from
Apr 6, 2020

Conversation

yradsmikham
Copy link
Collaborator

Copy link
Contributor

@jmspring jmspring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - my questions were answered in the design review

Copy link
Collaborator

@mtarng mtarng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the new flags --build-vg and --build-variables should be used in conjunction, and we won't be piggy-backing off another vg elsewhere.

Would we add these VG to the azdo project through spk project create-variable-group or spk variable-group create?

Additionally, I think we may need to expand the section about implementation:

we can add logic to iterate through the a
linked variable group and inject variables as arguments to be part of the
az acr build command

We will also need to expose each variable group variable as an environment variable in that pipeline step.

@yradsmikham
Copy link
Collaborator Author

yradsmikham commented Apr 2, 2020

So the new flags --build-vg and --build-variables should be used in conjunction, and we won't be piggy-backing off another vg elsewhere.

Would we add these VG to the azdo project through spk project create-variable-group or spk variable-group create?

Additionally, I think we may need to expand the section about implementation:

we can add logic to iterate through the a
linked variable group and inject variables as arguments to be part of the
az acr build command

We will also need to expose each variable group variable as an environment variable in that pipeline step.

Is there a preference as to which spk variable-group command we should be using for this situation?

Copy link
Collaborator

@andrebriggs andrebriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As part of the build-update-hld.yaml, where there is the "ACR Build and Publish" task (L208-L217) generated by spk service create, we can add logic to iterate through the a linked variable group and inject variables as arguments to be part of the az acr build command (i.e.az acr build -r $(ACR_NAME) -f $(DOCKER_BUILD_FILE) --build-arg $key=${value}).

@yradsmikham When exactly do we look at the variables in the variable group? Seems like this would have to happen "client side" before we git commit + push the build-update-hld.yaml file?

If a users adds additional args to their variable group do they have to call spk service create again locally, the commit and push?

@yradsmikham
Copy link
Collaborator Author

yradsmikham commented Apr 2, 2020

As part of the build-update-hld.yaml, where there is the "ACR Build and Publish" task (L208-L217) generated by spk service create, we can add logic to iterate through the a linked variable group and inject variables as arguments to be part of the az acr build command (i.e.az acr build -r $(ACR_NAME) -f $(DOCKER_BUILD_FILE) --build-arg $key=${value}).

@yradsmikham When exactly do we look at the variables in the variable group? Seems like this would have to happen "client side" before we git commit + push the build-update-hld.yaml file?

If a users adds additional args to their variable group do they have to call spk service create again locally, the commit and push?

@andrebriggs , we access the variables in the variable group when the services build pipeline (i.e. fabrikam.acme.frontend-pipeline) runs, or when the build-update-hld.yaml is executed. This should happen as we are running az acr build shown here.

If users make updates to their Dockerfile and require to add additional args to their variable group, they should (for now) just update their build-update-hld.yaml manually. This would mean adding a line to export the variable in the script, and adding another argument --build-arg $key=$value.

Thoughts? @jmspring @mtarng

@yradsmikham
Copy link
Collaborator Author

So the new flags --build-vg and --build-variables should be used in conjunction, and we won't be piggy-backing off another vg elsewhere.

Would we add these VG to the azdo project through spk project create-variable-group or spk variable-group create?

Additionally, I think we may need to expand the section about implementation:

we can add logic to iterate through the a
linked variable group and inject variables as arguments to be part of the
az acr build command

We will also need to expose each variable group variable as an environment variable in that pipeline step.

Sure, I can be a little more specific about this.

Copy link
Collaborator

@mtarng mtarng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks @yradsmikham

@mtarng
Copy link
Collaborator

mtarng commented Apr 6, 2020

As part of the build-update-hld.yaml, where there is the "ACR Build and Publish" task (L208-L217) generated by spk service create, we can add logic to iterate through the a linked variable group and inject variables as arguments to be part of the az acr build command (i.e.az acr build -r $(ACR_NAME) -f $(DOCKER_BUILD_FILE) --build-arg $key=${value}).

@yradsmikham When exactly do we look at the variables in the variable group? Seems like this would have to happen "client side" before we git commit + push the build-update-hld.yaml file?
If a users adds additional args to their variable group do they have to call spk service create again locally, the commit and push?

@andrebriggs , we access the variables in the variable group when the services build pipeline (i.e. fabrikam.acme.frontend-pipeline) runs, or when the build-update-hld.yaml is executed. This should happen as we are running az acr build shown here.

If users make updates to their Dockerfile and require to add additional args to their variable group, they should (for now) just update their build-update-hld.yaml manually. This would mean adding a line to export the variable in the script, and adding another argument --build-arg $key=$value.

Thoughts? @jmspring @mtarng

Though according to docs here, once we have a reference to the variables, we could use a script to iterate through them, making secret substitutions and passing them all into the build args. So as long as the variable group variable is updated somehow (either though a future spk command or the azdo UI) then the build script should have the latest arguments.

@yradsmikham yradsmikham merged commit b5d2773 into master Apr 6, 2020
@yradsmikham yradsmikham deleted the yvonne.designDoc branch April 6, 2020 21:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants