Prevent unnecessary artifact download when using Release Management
Asked Answered
B

4

14

I'm using TFS 2015 Update 2 Release Management (i.e, the "Release" tab), and I've got my build putting the desired output in a file share drop location. It looks something like:

/Drop
--> /App 1
--> /App 2
--> /App 3

My Release Definition has a Powershell task to deploy each application. This works great, and because each of the above apps (App 1, App 2, App 3) are all defined as their own artifacts, I get nice path selection when I bring up the Linked Artifacts dialog when finding the powershell script to execute.

The problem is when the VSOAgent is doing the deployment on a given deployment server, it downloads ALL linked artifacts for the entire release definition - regardless of if they're used. So if I have a single Powershell task referencing App 1, I get App 2 and App 3 downloaded as well.

In my case, my build results in dozens of artifacts, only perhaps 20% of which are deployed to any given environment. So I'm download a TON of stuff that I don't need. Indeed, this means something that should take (and DID take in the old Release Management) perhaps 5 minutes now takes 20 minutes just to download the artifacts.

Is there a way to prevent this?

Bleat answered 11/4, 2016 at 21:26 Comment(5)
What tasks are in your release definition?Nonobservance
Can you you use the Windows Machine File Copy task to copy just what you need to a target node and then use WinRM to carry out the deployment locally? Something like this.Incendiary
Why not store the artifacts to "Server" so that they're attached to the Build, instead of storing on a file share?Unbolted
There is now an extension for VSTS and on-prem TFS that solves the issue: github.com/chamindac/vsts.release.task.download-artifactsBleat
Microsoft never implemented this feature in VSTS/TFS 2018 Update 2, but closed the ticket as completed. If you want this feature, please vote on this cloned ticket on UserVoice.Torre
F
9

Release Management downloads all the artifacts published by the build definition that you selected by default. There isn't any setting to configure this for now. You can submit a feature request on VSTS User Voice.

Feune answered 12/4, 2016 at 1:59 Comment(1)
Done. Thanks. visualstudio.uservoice.com/forums/330519-team-services/…Bleat
S
5

I do not know if it is available in TFS 2015 Update 2 Release Management since we've already moved to update 3, but with Update 3 you can set this at the Environment level.

  1. On an Environment definition click the elipsis (...)
  2. Choose the menu option "Configure variables..."
  3. In the dialog window select "General" tab
  4. Toggle check-box "Skip artifacts download"

I don't have access to TFS 2015 Update 2, so you'd have to give it a try. Once you do this you can add tasks to manually file copy needed artifacts.

Scrap answered 9/8, 2017 at 16:55 Comment(1)
I can confirm TFS 2017 has this feature. Within your release and in the environment where your tasks are, if you click on "Run on Agent" there's actually an options set. Under additional options is the check box for "Skip artifacts download". I know the question was specifically for VSTS2015, but hopefully this information will be useful for those like myself that struggled to find the option in 2017.Stacte
D
3

Just released. VSTS and TFS 2018 has a new feature that might fit your needs

Previously, as part of a deployment phase, you could choose to either download all the artifacts or skip them all. Now you can choose the artifacts that need to be downloaded. This can save time by ensuring the agent only has to download what it needs. See the release artifacts documentation for more information. This feature was prioritized based on a suggestion.

https://learn.microsoft.com/en-us/visualstudio/releasenotes/tfs2018-update2#improve-release-times-by-partially-downloading-artifacts

https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/13396200-only-download-artifacts-required-for-task-executio?tracking_code=200f3ad38ab610cdbbdbb2afa5a9b7a5#{toggle_previous_statuses}

Demagnetize answered 8/5, 2018 at 21:2 Comment(1)
As you can see from the comments on the user voice forum, this feature is not available yet... also it's not in the release notes of update 2 (and not on 3)Luben
S
0
  1. Edit the appropriate release pipeline
  2. View stage tasks for the appropriate environment
  3. Select the main Agent job, a range of configuration should become available
  4. Scroll to the Artifact download section
  5. Select the artifacts to download or not
Steading answered 20/3, 2019 at 18:10 Comment(2)
Can't find any Artifact download section... only copy to machine and no interesting options for that.Neustria
Has anyone noticed any bugs on this feature? There will be times I have to download ALL of the artifacts, otherwise the one or two artifacts I explicitly selected for download will not be downloaded when running the release pipeline.Achievement

© 2022 - 2024 — McMap. All rights reserved.