10 Aug 2023

Design Automation: Introducing the New `adskZipMigration` Argument

Default blog image

Here, I would like to speak why we are introducing `adskZipMigration` and what problem this will solve.

What is the problem ?

The AutoCAD and Revit engines ignore localName for zip arguments most (but not all) of the time and unzip to the job root folder or working folder (incorrect localtion) instead of subfolder specified in localName(correct location).

Let's understand with a simple example 

If you look at the "InputFile" argument, the zip is set 'True'  and `pathInZip` is not null, as per documentation, the zip file passed through URL in workitem should uncompress to `inputs` directory on the DA server machine.

Unfortunately, due to a defect in our code, the localName parameter was not honored and any ZIP file was uncompressed to the working directory. Some developers started relying on this incorrect behavior to get the input files from the working directory. When we fixed the defect, the apps that relied on the incorrect behavior started to fail.

#

Activity

Workitem

Arg direction

Comments

1 zip==true pathInZip!=null input Zip is uncompressed to the folder specified in localname. Any path reference to this argument will expand to full path of pathInZip.

 

{
	"activityId": "aps.DrawingGeneration+prod",
	"arguments": {
		"InputFile": {
			"zip": true,
			"localName": "inputs",
			"pathInZip": "Template.dwg",
			"url": "url to download zip file"
		},
		"Result": {
			"url": "url to upload results",
			"localName": "outputs",
			"verb": "put",
			"headers": {
				"x-ms-blob-type": "BlockBlob",
				"Content-type": "application/octet-stream"
			}
		},
		"onComplete": {
			"url": "abc.url",
			"verb": "post"
		}
	}
}

 

 

What solution we are offering ?

We made some changes so that both behaviors are honored.

  1. The zip file will unzip to both the old (incorrect ) and new (correct) locations, but we will ignore all errors from the “secondary unzip”(to new location)
  2. We log migration warnings in the report if we have to do “secondary unzip” (which indicates the users that they need to migrate their apps).
    1. Log Example :
       
      Warning: Zip Migration: the input of 'input_1' is unzipped to the correct location of 'T:\Aces\Jobs\d278348cb72b4a40b8d6ac6ff3720066\vararg_input_1'.]
      [Runner] [INFORMATION] [0] [Runner] [EC2AMAZ-88Q8Q37] [WiID=d278348cb72b4a40b8d6ac6ff3720066. Warning: Zip Migration: the input of 'input_1' is unzipped to the correct location of 'T:\Aces\Jobs\d278348cb72b4a40b8d6ac6ff3720066\input_1'.]
      
  3. We also log migration warning in the report if we are forced to ignore errors from unzipping to the correct location
  4. We provide a new argument adskZipMigration in WorkItem so the user can test the apps/plugins/scripts which are migrated to the right behavior(the zip is only unzipped to subfolder specified in localName)

Payload Example:

{
   "activityId": "myNickName.mytest+Latest",
   "arguments": 
   {
      "input": {xxxxxxxx},
      "result": {yyyyyyyy},
      "adskZipMigration" : true
   }
}

 

Call for Action ?

 

During this period we will unzip to both locations and issue migration warnings as appropriate. We will be able to query our logs for customers who need to migrate. Our goal is to have no migration warning for at least 2 weeks before completely turn off the old behavior.

For any questions, please reach out to Get Help | Autodesk Platform Services

 

 

 

 

Related Article