Table Of Contents

Previous topic

Visual example of CDE usage

Next topic

Frequently asked questions

This Page

CDE streaming mode (experimental)

This tutorial shows you how to use CDE’s streaming mode to download and run Linux apps on-demand from a remote server. Note that this mode is experimental, so the implementation is probably not very robust. (Also, the writing is probably sloppy, too!)

Background

Let’s say you have a remote Linux server accessible via ssh at remote-server.com, and on that server you have all sorts of useful apps installed like the latest-and-greatest version of the Eclipse IDE with all sorts of whiz-bang extensions and plug-ins.

And let’s also say that your desktop Linux machine doesn’t have all sorts of nifty apps on it, but you want to run the nifty apps from the server locally on your machine. Well, you can use CDE’s streaming mode to “stream” those applications on-demand to your local machine and run them just like natively-installed apps.

Setting up your local machine

Since CDE’s streaming mode is experimental, I haven’t yet had time to write convenience scripts to setup your local machine for this mode, so you’ll have to do the setup manually. Here’s what you need to do:

First, let’s create a base working directory called, say, my-workspace/. Inside of that directory, create a few sub-directories:

$ mkdir my-workspace
$ mkdir my-workspace/cde-remote-root
$ mkdir my-workspace/cde-root

Now run cde echo hello (or any other trivial CDE command) to create a new cde-package/ sub-directory. Copy the cde.options and cde-exec files from cde-package/ into my-workspace:

$ cp cde-package/cde.options my-workspace/
$ cp cde-package/cde-exec my-workspace/

Now you need to log into your remote machine (ssh your_username@remote-server.com) and then run this command on there:

$ cat /proc/self/environ > cde.full-environment

This will copy the current environment variable values from the remote machine into cde.full-environment. Now copy that file into the my-workspace/ directory in your local machine. Now your directory structure should look like the following:

my-workspace/
  cde-exec             (executable)
  cde.full-environment (obtained from the remote server!)
  cde.options
  cde-root/
  cde-remote-root/

Using sshfs to mount the remote root

Now you can use sshfs to mount the root directory of the remote machine into the cde-remote-root/ mountpoint. The following options seem to work well for me:

$ cd my-workspace/
$ sshfs -o cache_timeout=1000000 -o transform_symlinks your_username@remote-server.com:/ cde-remote-root/

If your command ran successfully, then cde-remote-root/ will now contain the contents of the root directory from your remote server. The transform_symlinks option is very important for ensuring correctness in the presence of symlinks!

Running CDE in streaming mode

Now you should be able to run any command that’s available on the remote server using CDE’s streaming mode (cde-exec -s):

$ cd my-workspace/
$ ./cde-exec -s eclipse

The first time you run this command, it might take a minute or more to start up, since CDE needs to download all of the initial files from the remote server. CDE caches all of the downloaded files into the cde-root/ sub-directory, so in subsequent runs, CDE will simply use the local versions of those files from cde-root/ rather than hitting the remote server.

You can invalidate the local cache by simply deleting all the contents within cde-root/. (Note that CDE currently doesn’t have a way of detecting when individual files on the remote server have changed and thus invalidate their respective local cache entries.)

Note that when using streaming mode, you do not have to explicitly create a CDE package on the server. You only run cde-exec -s from your local (client) machine.