Overview
To easily run simulations in the cloud, DSim Cloud synchronizes all files, recursively, within the local root origin (the directory where mdc initialize command was executed) to the remote compute 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 initialization of a new workspace, only files that have changed are re-uploaded to the remote compute.
The synchronization of files is one-way only (from local to remote) meaning a file deleted, added or changed on the remote compute is not sync'd back to the local compute.
The user has control over which files are synchronized by modifying the sync_ignore
file contained within the .mdc
directory of the local root origin. By default, waveform DBs, downloaded files and a few other file patterns outlined later in this article are ignored.
The synchronization operation occurs at the following commands:
-
initialize
-
list
dsim
dvhcom
dvlcom
dlib
See below sections of this article for additional details on the functionality invoked at each of the above steps.
When synchronizing, an informational message is printed to the screen, providing statistics on total number of files synchronized and size of data transfer, is printed to the screen along with a status bar to indicate progress of the upload.
The output is similar to the message below.
Synchronization on Initialization
When users initialize a new workspace using the mdc initialize command, all files within the local root origin directory, other than those files that match patterns within the sync_ignore
file, will be synchronized to the remote compute recursively. The time taken to perform the initial synchronization will scale according to the size of the upload to the remote file system.
Upon execution of the mdc initialize
command, a default sync_ignore
file is written to the .mdc
directory. If a sync_ignore
file already exists (e.g. user has previously destroyed a workspace at the same location) the previous sync_ignore
will be re-used (will not be overwritten.)
For more information on the sync_ignore
file see Ignoring File Patterns.
If users find that the initial file synchronization is uploading too many files, as of the DSim Cloud 0.4.0 release, the mdc initialize
command can be interrupted in order to make adjustments to the directory contents or the sync_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 root origin will be synchronized to the remote workspace (except those whose name matches the patterns in the sync_ignore
) prior to the command executing. When synchronizing, an informational message is printed to the screen, providing statistics on the total number of files synchronized and the size of data transfer.
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 sync_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/sync_ignore
file will be ignored during a sync operation. Users can add specific file/directory patterns of choice by modifying the sync_ignore
file directly.
The default sync_ignore
file contains the following:
# Default file patterns to ignore when synchronizing files to the remote disk
*.log
# Waveform databases
*.vcd
*.mxd
# Downloaded files from the remote disk
_downloaded_*
# Git directory
.git*
Additionally, any .mdc
directory found within the local origin directory will not be synchronized.
The syntax used within the sync_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 sync_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 sync_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 mdc file synchronization is git. As a result, the following should be noted:
- Symbolic links will be treated as they are by git
- The syntax of the
sync_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/shell after the following commands are launched and on, or before, the file sync stage will interrupt any of the following commands' file sync stage:
-
-
initialize
- 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
-
list
dsim
dvhcom
dvlcom
dlib
-
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 root origin 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 root origin directory override changes on the remote system.
Below are a few examples:
- If a command overwrites a synced file, the file will be synced again from the user's local root origin directory upon the next sync operation
-
If file sync overwrites a simulation artifact (say, a waveform file) this will be silently accepted
-
If a file is deleted in the local root origin directory it should be removed from the remote directory (regardless if it is changed or not there)
File Permissions
-
All files uploaded to the remote workspace should have read and write permissions, regardless of local permissions
-
Execute permission on specific files/directories is synced from the local filesystem (for both user and group)
Miscellaneous
-
If the user kills an
mdc
command (e.g. kill -9) before the end of the file synchronization, it is allowed to have corrupted files on the remote disk -
Running two (or more) sync operations at the same time can result in an unstable transient status of a file, but must end up with one of the versions of the file.
-
A Sync operation, while another command is executed, is allowed to change files. This may cause an unknown result of the command.