How to set rust project's cache (OD-2437)
chenyustart opened 8 months ago

I deployed a CI/CD pipeline on OneDev, started OneDev with docker, and used another linux machine as an agent. Now I want to provide cache for my rust project build to speed up the pipeline, however, the agent machine currently only supports Remote Shell Executor. In this case, I wonder:

  1. How to specify the cache that can be used when cargo build? I tried to use the Cargo.lock file in the project root directory to generate checksum as in the tutorial, but this can only be used in docker executor at present.
  2. The first step of my current pipeline job is checkout code. I expected to clone the project code on the agent machine, and after the cargo build is completed, specify the files in the target directory in the setup cache step of Onedev to provide the build cache, and then I received a prompt--Cache path does not allow to contain '..': ../../../../../../../path/to/my_project/target. I am confused now. I wonder if you know about this and can provide some suggestions.
  • Robin Shen commented 8 months ago

    The agent machine currently only supports Remote Shell Executor

    As long as your agent machine has docker installed, you can use remote docker executor.

  • chenyustart commented 8 months ago

    The agent machine currently only supports Remote Shell Executor

    As long as your agent machine has docker installed, you can use remote docker executor.

    So the same approach doesn't work with Remote Shell Executor? Maybe this is a little contrived, I still want to understand the feasibility of this.

  • Robin Shen commented 8 months ago

    Remote shell executor should work also with rust, but it depends on your host environment, and can only cache folders relative to job workspace.

  • Robin Shen changed state to 'Closed' 7 months ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2437
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover