Setting up Item Caching

You can define and use an item 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.


Before you begin:
  • The item must be in the Frozen or Released maturity state.
  • Install the Semiconductor Repo command-line client.
See Also
Semiconductor Repository Caching
Setting up File Caching for Semiconductor Repo
  1. On a disk partition, shared with the users who need to use the cache, create a directory, for example: mkdir /home/semirepo/itemcaches/NX1ProjectItem
  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/itemcaches/NX1ProjectItem
    chmod ug+rw /home/semirepo/itemcaches/NX1ProjectItem 

  3. Create a configuration file to store the definition of the cache. 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.
    OptionDescription
    Create a configuration file with sws config You can use the sws config file to define the cache path location for the item cache paths. You can specify multiple path names using a colon (:) delimiter.
    sws config cache.paths=[path[:path]]
    Create a configuration file manually The configuration file is in JSON format and contains the locations of the cache directory in this general format:
    {
      …
      "cache": {
          "paths": [<PATH>]
       }
    }
    
    Note: Use the comma to separate multiple path values. If you are only using one path, do not use a comma. Do not use a comma after the last path in the list.
    For example:
    {
      …
      “cache”: {
          “paths”: ["/home/semirepo/itemcaches/NX1ProjectItem", "/home/semirepo/itemcaches/NX1ProjectItem2"]
       }
      …
    }
    
    Note: Use a .cfg file extension for the cache file definition.
  4. Each cache user can use the SWS_CONFIG environment variable with the location for the configuration file, for example:

    export SWS_CONFIG=/home/semirepo/itemcaches/NX1ProjectItem/NX1projectItem.cfg
    Note: If there is no central configuration file, the individual cache users set the SWS_CONFIG variable to their own config file. By default, the system looks for the config file in the following locations in this order:
    1. .sws/config subdirectory in the local sws design workspace,
    2. $HOME/.dshome/sws/config in the user's home directory,
    3. SWS_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: The item cache is enabled. Items are purged from the item cache when all of their files are obsolete or the item was removed from the workspace. To disable item caching, remove the environment variable or the .cfg file.