Create a Lab with Files Over 50MB

How to get around the 50MB file limit when creating a lab.

Currently labs can contain up to 50MB of files in the watched directory (typically /home/nt-user/workspace). If there are large files in a lab that a user will not need to edit, the following steps can be taken to add them to the lab:

  1. Create a lab using the Creator.

  2. Add the names of the large files or folders in the 'Excluded Files Patterns' list as shown in the image below. Note that multiple entries should be separated by newlines and the * wildcard character is supported.

Excluding the node_modules folder from being saved in the Creator

3. Create a compressed archive of the files that were added in the 'Excluded Files Patterns'.

Ex. tar -czvf node_modules.tgz /home/nt-user/workspace/hello-world/node_modules

4. Upload the archive to a cloud storage provider such as AWS S3 or Google Storage. Uploading it to a public GitHub repository also works.

5. Add a startup script to download and extract the archive into the lab. An example of a possible startup script is as follows (click here for more information on adding startup scripts):

wget -q -O /tmp/node_modules.tgz https://example.com/node_modules.tgz
mkdir -p /home/nt-user/workspace/hello-world/node_modules/
tar -xzf /tmp/node_modules.tgz --directory /home/nt-user/workspace/hello-world/node_modules/ --strip-components=1
rm -f /tmp/node_modules.tgz

This uses wget to download the compressed node_modules.tgz file to the /tmp directory. Next it ensures the destination folder exists. Then it extracts the compressed files to the desired folder. Finally it removes the archive that was downloaded to the /tmp directory.

That's it! The large files will now be downloaded to the lab each time it is launched.

‚Äč