Setting up File Caching for Semiconductor Repo

You can define and use a semiconductor repository cache to efficiently share read-only files across multiple workspaces. It also improves the speed of checkouts and reduces the amount of traffic across the network.

See Also
Semiconductor Repository Caching
  1. On a disk partition, shared with the users who need to use the cache, create a directory, for example: mkdir /home/semirepo/caches/NX1Project
  2. Set the permissions on the directory to read/write for the users and groups using the cache.

    Tip: Add all the users on a project into a group so that only the group using the cache has permissions to use the cache, for example:
    chgroup NX1ProjectTeam /home/semirepo/caches/NX1Project
    chmod ug+rw /home/semirepo/caches/NX1Project 

  3. Create a configuration file to store the cache definition. The configuration file must be accessible to the users who can access the cache. Storing the definition of the cache in a common location allows you to update the location information if you move the cache. The configuration file is in JSON format and contains the locations of the cache directory in this general format:

    Note: The configuration file also stores the aging policy of unused data in the cache. By default, the system scrubs unused files after 28 days. If you want to change the aging policy, add the information here as shown.
    {
      …
      "cache": {
          "dir": <CACHE_DIR>,
          "age": <AGE>
          }
    }
    For example:
    {
      …
      “cache”: {
          “dir”: "/home/semirepo/caches/NX1Project",
          "age":90
    }
    

  4. Each cache user can use the DSREPO_CONFIG environment variable with the location for the configuration file, for example:

    export DSREPO_CONFIG=/home/semirepo/caches/NX1projectcache.cfg
    Note: If there is no central configuration file, the individual cache users set the DSREPO_CONFIG variable to their own config file. By default, the system looks for the config file in the following locations in this order:
    1. .dsrepo/config subdirectory in the current working directory,
    2. $HOME/.dshome/dsrepo/config in the user's home directory,
    3. DSREPO_CONFIG environment variable.
    Tip: Add the environment variable definition to the .login scripts for the users or to a client startup script, so it is always available to the user when they need it.

Result: Caching is now configured for use. To disable caching, remove the cache.dir setting from the configuration file, or unset the DSREPO_CONFIG environment variable that points to the configuration file.