Automated upload

Upload a packaged build from a build machine or a pipeline, and wait for its stream test - with a ready script, a workflow or your own code. Every way ends with PASSED or FAILED and an exit code, so a pipeline stops on a failed build. Part of E3DS CI/CD.

Which way fits you

You want toUseWhat it does
Upload from inside UnrealE3DS CI/CD plugin for UnrealPackages, zips and uploads from the Unreal Editor.
Upload with PythonPython scriptPython 3.8+, nothing to install. macOS, Linux or Windows.
Upload from Windows with nothing to installPowerShell scriptBuilt into Windows 10 and 11.
Upload with Node.js, no packagesNode.js scriptNode.js 18+.
Upload from your own Node.js codeE3DS CI/CD for Node.js (npm)One function call: zip path, API key, app name.
Upload on every buildGitHub Actions; Jenkins, Azure DevOpsThe upload runs right after packaging; a failed test stops the pipeline.
Write your own uploader, any languageREST APIThe same steps as the scripts, request by request.
Upload now and then, by handThe Control Panel uploaderChecks the zip before it leaves your computer, uploads, tests.

Whatever you use, every upload is stream tested: the build is started on a streaming machine and must show a picture before it is marked ready. A build that cannot start is reported with the reason, before any viewer sees it.

Before you start

What every script does

  1. Starts the upload (your app name and the file size) and gets the new version, like v1795139555393.
  2. Sends the zip in parts, showing how much is sent. A part that fails is tried again (six tries).
  3. Completes the upload. Our server then starts the stream test of the new version by itself.
  4. Waits for the result (usually 3 to 8 minutes) and ends with PASSED or FAILED. The exit code is 0 when it passed, so a build pipeline can stop on a failure. Waiting is optional: the result also comes by email and in the Control Panel (use --no-wait, in PowerShell -NoWait, to upload without waiting). If an upload stops, run the same command again: it continues where it stopped.

Resumable uploads: a stopped upload continues where it stopped

Every upload made with the Python, PowerShell and Node.js scripts, the E3DS CLI and the REST API is resumable. A big build never has to start again from zero because a connection dropped.

  1. The zip goes up in parts (10 MB each by default, several at the same time). Each part is sent on its own.
  2. A part that fails is sent again by itself - up to six tries, with a short wait in between. A brief network hiccup is handled without you noticing.
  3. If the upload stops completely - the network goes down, the computer sleeps, the window is closed, you press Ctrl+C - run the same command again with the same zip and the same app name, within 24 hours. Our server recognises the upload and the script sends only the parts that are still missing. The first line then says how many parts were already there, for example:
    1. upload started: app 'MyGame', version v1795161535351, 22 part(s) of 10 MB, 4 at a time - resuming, 14 part(s) already sent
    The version number stays the same - it is the same upload, continued.
  4. After 24 hours an unfinished upload is discarded, and running the command starts a new upload from the beginning.

Our server recognises an unfinished upload by three things: the app name, the file name and the file size. When the script gives up on the network, it ends with exit code 4 (the E3DS CLI: 5) - not 1, which is kept for a build that failed its stream test - so a pipeline can tell the two apart and simply run the upload step again.

What happenedWhat to doWhat happens
A part failed once or twiceNothingThe script sends that part again by itself.
The upload stopped (network down, window closed, Ctrl+C)Run the same command again within 24 hoursIt continues with the missing parts; nothing already sent is sent again.
You changed the zip (a new build)Run the commandA new upload starts - a zip with a different size is a new version.
The upload finished, and you run the same command againNothing to doA new upload starts and the whole zip is sent again, as a new version.
More than 24 hours passedRun the commandA new upload starts from the beginning.

In a build pipeline this means a retry step is enough: if the upload step fails because of the network, running it again finishes the same upload instead of sending the whole build a second time.

Tip for pipelines: give every build's zip its own name, for example with the build number (MyGame-1234.zip). A new build almost always has a different size, but if an unfinished upload of a zip with the same name and the same size is still waiting, the new zip would continue it - a unique name makes sure every build starts its own upload.

Watch it in 1:27

Resumable uploadsVideo · 1:27

Package and zip the build (Unreal)

On a Windows build machine with Unreal Engine installed, package the project for Windows and zip the result:

# package (adjust the engine and project paths)
& "C:\Program Files\Epic Games\UE_5.5\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun `
  -project="C:\Projects\MyGame\MyGame.uproject" -platform=Win64 -clientconfig=Shipping `
  -build -cook -stage -pak -archive -archivedirectory="C:\Builds\MyGame"

# zip the packaged folder (the one that holds MyGame.exe and the MyGame folder)
Compress-Archive -Path "C:\Builds\MyGame\Windows\*" -DestinationPath "C:\Builds\MyGame.zip" -Force

Then upload MyGame.zip with any of the ways above. More on the zip: prepare your app in Unreal.

In a build pipeline

Store the API key as a secret of your pipeline and expose it as E3DS_API_KEY. Run the script right after packaging. The exit code is 0 only when the build passed the stream test, so a failed build stops the pipeline there.

GitHub Actions, step by step with a video: Upload on every build with GitHub Actions.

Jenkins

stage('Upload to Eagle 3D Streaming') {
  steps {
    withCredentials([string(credentialsId: 'e3ds-api-key', variable: 'E3DS_API_KEY')]) {
      bat 'python e3ds_upload.py C:\\Builds\\MyGame.zip MyGame'
    }
  }
}

Azure DevOps

- task: PowerShell@2
  displayName: Upload to Eagle 3D Streaming
  env:
    E3DS_API_KEY: $(E3DS_API_KEY)       # a secret pipeline variable
  inputs:
    filePath: e3ds-upload.ps1
    arguments: C:\Builds\MyGame.zip MyGame

Keep your API key safe

When it fails

The script saysWhat it means
Set E3DS_API_KEY to your API key firstThe environment variable is missing in this terminal.
Could not start the upload (HTTP 401 / 403)The API key is wrong or belongs to another account.
Could not start the upload (HTTP 400: app: 1-100 characters, letters, digits and _ only.)The app name has a space or another character that is not allowed.
Could not start the upload ... (a message about storage)Your storage is full: free space or add storage in the Control Panel.
try 3/6 failed ... trying againA network hiccup; the script retries by itself.
UPLOAD FAILED: giving up after 6 tries ...The network was gone for longer than about a minute. Exit code 4. Run the same command again: it continues where it stopped.
REPLACED by a newer upload ...You uploaded the same app again before this version was tested; only the newest upload is tested and can go live. Exit code 2 - the newer upload reports its own result.
PASSED, but a newer version is liveThis build passed, but a newer upload of the app passed first; the newest one stays live and this one is kept as a version. Exit code 0.
FAILED: ...The build did not start in the stream test - see the stream test report for the reasons.
NO RESULT after 45 minutesThe test is still queued or running; the result comes by email and in the Control Panel. Exit code 3.

Exit codes

The upload ended withPython, PowerShell and Node.js scriptsE3DS CLI
PASSED (also "PASSED, but a newer version is live"), or uploaded with --no-wait00
FAILED: the build did not pass the stream test11
REPLACED: not tested, a newer upload of the same app is tested instead26
No result within the timeout34
The upload itself failed: API key, app name, file, or the network (run it again to continue)43 key or app rejected, 2 wrong argument or file, 5 network

In this section

Related

Last updated