DSim Cloud Interactive File Synchronization

Modified on Tue, 9 Jul at 6:07 PM

DSim Cloud Interactive File Synchronization

Overview

To easily run simulations in the cloud, DSim Cloud synchronizes all files, recursively, within the local workspace to the remote workspace within the /remote/work directory. To provide a seamless user experience, this synchronization is done automatically for the user in a performance-friendly manner. For example, after initial startup is complete, only new files or files that have been modified are uploaded in subsequent synchronizations.


The synchronization of files is one-way only (from local to remote) meaning a file deleted, added or modified in the remote workspace is not synced back to the local workspace.


Only diffs from the last sync are copied up to the remote workspace. For example, after initial start of a remote workspace, only files that have changed are re-uploaded to it. If a local workspace is large and determining difference takes a long time, an alternative sync strategy is used where all files are copied up.


You can control which files are ignored during a synchronization by modifying the mdc_ignore file contained in the local workspace. By default, waveform DBs, downloaded files and a few other file patterns outlined later in this article are ignored. For more information on the mdc_ignore file see Ignoring File Patterns.


The synchronization operation occurs at the following commands:


  1. mdc workspace start
  2. mdc list
  3. mdc dsim
  4. mdc dvhcom
  5. mdc dvlcom
  6. mdc dlib
  7. mdc dvhencrypt
  8. mdc dvlencrypt
  9. mdc envs

See the below sections of this article for additional details on the functionality invoked at each of the above steps.



Synchronization on Start

When a new workspace is started, all files within the local workspace directory, other than those files that match patterns within the mdc_ignore file, will be synchronized to the remote workspace recursively.


If users find that the initial file synchronization is uploading too many files, the mdc start command can be interrupted in order to make adjustments to the directory contents or the mdc_ignore file. See Using Ctrl-C to Interrupt File Synchronization for more information.



Synchronization on Commands

When users perform a command such as mdc dsim -a '-help', all changes in the local workspace will be synchronized to the remote workspace (except those whose name matches the patterns in the mdc_ignore) prior to the command executing.


If users find that the file synchronization on any command is uploading too many files, the command can be interrupted in order to make adjustments to the directory contents or the mdc_ignore file. See Using Ctrl-C to Interrupt File Synchronization for more information.



Ignoring File Patterns

Any file/directory names that match the patterns in the mdc_ignore file will be ignored during a sync operation. Users can add specific file/directory patterns of choice by modifying the mdc_ignore file directly.


The default mdc_ignore file contains the following:


 

<div id="default_file_patterns_to_ignore_when_synchronizing_files_to_the_remote_disk"></div>

# Default file patterns to ignore when synchronizing files to the remote disk
*.log

<div id="waveform_databases_"></div>

# Waveform databases 
*.vcd
*.mxd

<div id="downloaded_files_from_the_remote_disk"></div>

# Downloaded files from the remote disk
_downloaded_*

<div id="git_directory"></div>

# Git directory
.git*

 

Additionally, any .mdc directory found within the local workspace directory will not be synchronized.


The syntax used within the mdc_ignore uses the rsync/git ignore pattern format which is a newline-separated list of glob patterns. Comments can be added to the file by starting the line with #.


If a user accidentally deletes the mdc_ignore file, no ignoring of files/directories will occur. However, any .mdc directory found within the local workspace root shall be ignored automatically, without requiring users to add this to the mdc_ignore file (even if the ignore file doesn't exist)



Additional Notes


git Technology

It is worthwhile to note that the underlying technology being used for DSim Cloud file synchronization is git. As a result, the following should be noted:


  1. Symbolic links will be treated as they are by git
  2. The syntax of the mdc_ignore file uses git ignore pattern format (which is a newline-separated list of glob patterns)

Using Ctrl-C to Interrupt File Synchronization

Entering the key combination Ctrl-C together on the local terminal after the following commands are launched and on, or before, the file sync stage will interrupt any of the following commands' file sync stage:


  1. mdc workspace start
    • In the event that Ctrl-C is used to interrupt the initial file synchronization, all files will be synchronized again at the next simulation command
  2. mdc list
  3. mdc dsim
  4. mdc dvhcom
  5. mdc dvlcom
  6. mdc dlib
  7. mdc dvhencrypt
  8. mdc dvlencrypt
  9. mdc envs

There is an exception in that, if the user enters Ctrl+C at a point after the upload of the change manifest (upload progress bar is no longer visible on screen), the file sync operation will continue to completion.



Conflict Resolution

The local workspace directory will always be considered as the Single Source of Truth (SSOT). As a result, conflict resolution is always one way. Any changes in the local workspace directory override changes in the remote workspace.


Below are a few examples:


  1. If a command overwrites a synced file, the file will be synced again from the user's local workspace directory upon the next sync operation


  2. If file sync overwrites a simulation artifact (say, a waveform file) this will be silently accepted


  3. If a file is deleted in the local workspace directory it will be removed from the remote directory



File Permissions

  1. All files uploaded to the remote workspace will have read and write permissions, regardless of local permissions


  2. Execute permission on specific files/directories is synced from the local filesystem (for both user and group)



Miscellaneous

  1. Killing an mdc command (e.g. kill -9) before the end of the file synchronization may result in a corrupt synchronization state. This can be corrected by destroying and starting the DSim Cloud Interactive workspace again.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article