Skip to content

Enhance benchmark workflow and download#2340

Merged
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main
Mar 4, 2026
Merged

Enhance benchmark workflow and download#2340
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main

Conversation

@seokho-son
Copy link
Copy Markdown
Member

Enhance benchmark workflow and download

@seokho-son seokho-son requested a review from yunkon-kim as a code owner March 4, 2026 09:26
Copilot AI review requested due to automatic review settings March 4, 2026 09:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances benchmark automation outputs and adds an API to download files from an MCI VM via bastion/SCP, alongside related REST route + swagger updates.

Changes:

  • Add POST /ns/{nsId}/downloadFile/mci/{mciId}/vm/{vmId} endpoint and core SCP-via-bastion implementation to download a remote file.
  • Increase MCI file upload size limit from 10MB to 50MB.
  • Improve run_guidellm.sh to better report generated outputs, run multiple targets in parallel, and archive results.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/interface/rest/server/server.go Registers the new download-file REST route.
src/interface/rest/server/infra/remoteCommand.go Implements REST handler; raises upload limit; adds swagger annotations for download.
src/core/infra/remoteCommand.go Adds SCP download implementation via bastion to return file bytes + name.
src/core/model/mci.go Adds model.FileDownloadReq request schema.
src/interface/rest/docs/swagger.yaml Documents the new download endpoint and request model.
src/interface/rest/docs/docs.go Updates generated swagger docs for the new endpoint/model.
scripts/usecases/llm/telemetry/run_guidellm.sh Parallelizes multi-target runs and produces a tar.gz archive of outputs.
Comments suppressed due to low confidence (1)

src/interface/rest/server/infra/remoteCommand.go:200

  • RestPostFileToMci now allows 50MB uploads, but the swagger annotations above still state “less than 10MB” and the file param says “Max 10MB”. Please update the endpoint description/param docs (and regenerated swagger) to match the actual limit (or keep the limit at 10MB if that was intentional).
// RestPostFileToMci godoc
// @ID PostFileToMci
// @Summary Transfer a file to specified MCI
// @Description Transfer a file to specified MCI to the specified path.
// @Description The file size should be less than 10MB.
// @Description Not for gerneral file transfer but for specific purpose (small configuration files).
// @Tags [MC-Infra] MCI Remote Command
// @Accept  multipart/form-data
// @Produce  json
// @Param nsId path string true "Namespace ID" default(default)
// @Param mciId path string true "MCI ID" default(mci01)
// @Param subGroupId query string false "subGroupId to apply the file transfer only for VMs in subGroup of MCI" default(g1)
// @Param vmId query string false "vmId to apply the file transfer only for a VM in MCI" default(g1-1)
// @Param path formData string true "Target path where the file will be stored" default(/home/cb-user/)
// @Param file formData file true "The file to be uploaded (Max 10MB)"
// @Param x-request-id header string false "Custom request ID"
// @Success 200 {object} model.MciSshCmdResultForAPI
// @Failure 400 {object} model.SimpleMsg "Invalid request"
// @Failure 500 {object} model.SimpleMsg "Internal Server Error"
// @Router /ns/{nsId}/transferFile/mci/{mciId} [post]
func RestPostFileToMci(c echo.Context) error {

	nsId := c.Param("nsId")
	mciId := c.Param("mciId")
	subGroupId := c.QueryParam("subGroupId")
	vmId := c.QueryParam("vmId")
	targetPath := c.FormValue("path")

	if targetPath == "" {
		err := fmt.Errorf("target path is required")
		return clientManager.EndRequestWithLog(c, err, nil)
	}

	// Validate the file
	file, err := c.FormFile("file")
	if err != nil {
		err = fmt.Errorf("failed to read the file %v", err)
		return clientManager.EndRequestWithLog(c, err, nil)
	}

	// File size validation
	fileSizeLimit := int64(50 * 1024 * 1024) // (50MB limit)
	if file.Size > fileSizeLimit {
		err := fmt.Errorf("file too large, max size is %v", fileSizeLimit)
		return clientManager.EndRequestWithLog(c, err, nil)
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Seokho Son <shsongist@gmail.com>
@seokho-son
Copy link
Copy Markdown
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Mar 4, 2026
@cb-github-robot cb-github-robot merged commit 72c4b0e into cloud-barista:main Mar 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants