Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @actions/artifact v2.0.0+ and upload-artifact@v4+ support #205

Closed
ChristopherHX opened this issue Aug 17, 2023 · 2 comments · Fixed by #287
Closed

Add @actions/artifact v2.0.0+ and upload-artifact@v4+ support #205

ChristopherHX opened this issue Aug 17, 2023 · 2 comments · Fixed by #287
Labels
enhancement New feature or request

Comments

@ChristopherHX
Copy link
Owner

GitHub Decided to not implement any kind of fallback for old backends.

See https://github.com/actions/toolkit/blob/c9dab8c79daa06e0897ededaf7de9c351d22fec3/packages/artifact/README.md

  • Upload artifacts needs a protobuf backend
  • Download artifacts get's tricky, we would need to alter github.api_url to point to this backend and forward all non mapped apis to the real backend... (Maybe add a flag to restore current behavior)

It's no longer possible to download artifacts without using the public rest api, but it seems like we no longer need to wait for completion of the workflow run otherwise it would break everything.

@ChristopherHX ChristopherHX added the enhancement New feature or request label Aug 17, 2023
@ChristopherHX
Copy link
Owner Author

the action v4 is rolled out for .com

Some details written here nektos/act#2135

@ChristopherHX
Copy link
Owner Author

Status Update Uploading Artifacts works. The SignedUploadUrl has to correctly return 201, next steps are to really store them in the backend and allow downloading.

Also the SignedUploadUrl needs to be signed by our rsa private key, because we don't get our jwt token passed to that url

[testworkflows/artifactv4.yml] Running: testworkflows/artifactv4.yml
| Initialize Workflow Run 1
| Updated Workflow Name: gzipart
[gzipart / y] Running: y
| Evaluate if
| Evaluating: success()
| Evaluating success:
| => true
| Result: true
| Prepare Job for execution
| Evaluate job name
| Evaluate job continueOnError
| Evaluate job timeoutMinutes
| Evaluate job cancelTimeoutMinutes
| Evaluate runs-on
| Queued Job: y for queue self-hosted
| Read Job from Queue: y assigned to Runner Name:edp15elp.oa5 Labels:self-hosted
| Send Job to Runner: y for queue self-hosted assigned to Runner Name:edp15elp.oa5 Labels:self-hosted
| ##[debug]Starting: y
| ##[debug]Cleaning runner temp folder: C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\_temp
[gzipart / y] Running: Set up job
| ##[debug]Starting: Set up job
| Current runner version: '2.311.0'
| Runner name: 'edp15elp.oa5'
| Runner group name: 'Default'
| Machine name: 'DESKTOP-3SVG86B'
| Secret source: Actions
| ##[debug]Primary repository: ChristopherHX/runner.server
| Prepare workflow directory
| ##[debug]Creating pipeline directory: 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\runner.server'
| ##[debug]Creating workspace directory: 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\runner.server\runner.server'
| ##[debug]Update context data
| ##[debug]Evaluating job-level environment variables
| ##[debug]Evaluating job container
| ##[debug]Evaluating job service containers
| ##[debug]Evaluating job defaults
| Prepare all required actions
| Getting action download info
| Download action repository 'actions/upload-artifact@v4' (SHA:)
| ##[debug]Download 'https://github.com/actions/upload-artifact/archive/v4.zip' to 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\_actions\_temp_d15e4040-036f-439f-907d-b3555e3b27cf\061d5e51-27a5-4ad2-b21f-934f463f65de.zip'
| ##[debug]Unwrap 'upload-artifact-4' to 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\_actions\actions\upload-artifact\v4'
| ##[debug]Archive 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\_actions\_temp_d15e4040-036f-439f-907d-b3555e3b27cf\061d5e51-27a5-4ad2-b21f-934f463f65de.zip' has been unzipped into 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\_actions\actions\upload-artifact\v4'.
| ##[debug]action.yml for action: 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\_actions\actions\upload-artifact\v4\action.yml'.
| ##[debug]Set step '' display name to: 'Run echo "Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" > gzip.txt'
| ##[debug]Set step '' display name to: 'Run actions/upload-artifact@v4'
| Uses: ChristopherHX/runner.server/testworkflows/artifactv4.yml
| Complete job name: y
| ##[debug]Collect running processes for tracking orphan processes.
| ##[debug]Finishing: Set up job
[gzipart / y] Succeeded: Set up job
[gzipart / y] Running: Run echo "Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" > gzip.txt
| ##[debug]Evaluating condition for step: 'Run echo "Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" > gzip.txt'
| ##[debug]Evaluating: success()
| ##[debug]Evaluating success:
| ##[debug]=> true
| ##[debug]Result: true
| ##[debug]Starting: Run echo "Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" > gzip.txt
| ##[debug]Loading inputs
| ##[debug]Loading env
| ##[group]Run echo "Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" > gzip.txt
| echo "Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" > gzip.txt
| shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
| ##[endgroup]
| ##[debug]C:\Program Files\PowerShell\7\pwsh.EXE -command ". 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\_temp\6afff1c8-bde6-4efe-9595-8d7216e29522.ps1'"
| Unable to provide System.CommandLine tab completion support unless the [dotnet-suggest] tool is first installed.
| See the following for tool installation: https://www.nuget.org/packages/dotnet-suggest
| ##[debug]Finishing: Run echo "Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" > gzip.txt
[gzipart / y] Succeeded: Run echo "Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" > gzip.txt
[gzipart / y] Running: Run actions/upload-artifact@v4
| ##[debug]Evaluating condition for step: 'Run actions/upload-artifact@v4'
| ##[debug]Evaluating: success()
| ##[debug]Evaluating success:
| ##[debug]=> true
| ##[debug]Result: true
| ##[debug]Starting: Run actions/upload-artifact@v4
| ##[debug]Loading inputs
| ##[debug]Loading env
| ##[group]Run actions/upload-artifact@v4
| with:
|   name: GzipTest
|   path: gzip.txt
|   if-no-files-found: warn
|   compression-level: 6
| ##[endgroup]
| Debugger attached.
| ##[debug]followSymbolicLinks 'true'
| ##[debug]implicitDescendants 'true'
| ##[debug]omitBrokenSymbolicLinks 'true'
| ##[debug]followSymbolicLinks 'true'
| ##[debug]implicitDescendants 'true'
| ##[debug]matchDirectories 'true'
| ##[debug]omitBrokenSymbolicLinks 'true'
| ##[debug]Search path 'C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\runner.server\runner.server\gzip.txt'
| ##[debug]File:C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\runner.server\runner.server\gzip.txt was found using the provided searchPath
| With the provided path, there will be 1 file uploaded
| ##[debug]Root artifact directory is C:\Users\Christopher\AppData\Local\gharun\a\edp15elp.oa5\w\runner.server\runner.server
| Artifact name is valid!
| Root directory input is valid!
| ##[debug]Workflow Run Backend ID: ce7f54c7-61c7-4aae-887f-30da475f5f1a
| ##[debug]Workflow Job Run Backend ID: ca395085-040a-526b-2ce8-bdc85f692774
| ##[debug][Request] CreateArtifact http://192.168.178.20:60755/twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact
| ##[debug][Response] - 200
| ##[debug]Headers: {
| ##[debug]  "content-type": "text/plain; charset=utf-8",
| ##[debug]  "date": "Wed, 20 Dec 2023 13:17:30 GMT",
| ##[debug]  "server": "Kestrel",
| ##[debug]  "transfer-encoding": "chunked"
| ##[debug]}
| ##[debug]Body: {
| ##[debug]  "ok": true,
| ##[debug]  "signed_upload_url": "http://192.168.178.20:60755/twirp/github.actions.results.api.v1.ArtifactService/UploadArtifact"
| ##[debug]}
| ##[debug]Creating Artifact archive with compressionLevel: 6
| ##[debug]Zip write high watermark value 8388608
| ##[debug]Zip read high watermark value 8388608
| ##[debug]Uploading artifact zip to blob storage with maxConcurrency: 128, bufferSize: 8388608
| Beginning upload of artifact content to blob storage
| ##[debug]Zip stream for upload has finished.
| ##[debug]Zip stream for upload has ended.
| Uploaded bytes 233
| Finished uploading artifact content to blob storage!
| SHA256 hash of uploaded artifact zip is 67c7600fe81257c8f9a252c9cb12e2e7e1892596352959f62e85cfabb79e31ac        
| Finalizing artifact upload
| ##[debug][Request] FinalizeArtifact http://192.168.178.20:60755/twirp/github.actions.results.api.v1.ArtifactService/FinalizeArtifact
| ##[debug][Response] - 200
| ##[debug]Headers: {
| ##[debug]  "content-type": "text/plain; charset=utf-8",
| ##[debug]  "date": "Wed, 20 Dec 2023 13:17:43 GMT",
| ##[debug]  "server": "Kestrel",
| ##[debug]  "transfer-encoding": "chunked"
| ##[debug]}
| ##[debug]Body: {
| ##[debug]  "ok": true,
| ##[debug]  "artifact_id": "1"
| ##[debug]}
| Artifact GzipTest.zip successfully finalized. Artifact ID 1
| Artifact GzipTest has been successfully uploaded! Final size is 233 bytes. Artifact ID is 1
| Waiting for the debugger to disconnect...
| ##[debug]Node Action run completed with exit code 0
| ##[debug]Set output artifact-id = 1
| ##[debug]Finishing: Run actions/upload-artifact@v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant