Skip to content

Lesson 3 of 5

Shipping in Someone Else's Systems

See how an FDE ships reliable software within a customer's environment, handling constraints and security.

6 minForward Deployed Engineering

After this lesson, you will be able to describe how a Forward Deployed Engineer ships reliable software inside a customer's systems, work within common constraints, and apply basic security practices.

What shipping means for an FDE

A Forward Deployed Engineer writes code that runs on a customer's computers, not on your own company's servers. The customer may have old hardware, restricted networks, or strict rules about what software can do. Shipping means getting your code installed, running, and useful in that environment.

You will often start with a small, working piece of software and improve it over time. The goal is to solve a real problem for the customer, not to build a perfect system on the first day.

Understanding the customer's environment

Before you write code, you need to learn about the customer's systems. Ask questions like:

  • What operating system and version do they use?
  • Can you install new software, or must you use what is already there?
  • Is the machine connected to the internet, or is it on a private network?
  • Who will use the software, and what permissions do they have?

The answers shape your choices. For example, if the customer cannot install Python, you might write a small program in a language they already have, or package your Python code into a single executable file.

Writing code that fits in

A simple example shows how to write a script that works in a restricted environment. Suppose the customer has a Linux server with Python 3 installed, but no internet access. You need to check disk space and report it to a log file.

Create a file called disk_check.py with this content:

import shutil
import datetime
import os
import tempfile

def main():
    total, used, free = shutil.disk_usage('/')
    now = datetime.datetime.now().isoformat()
    log_path = os.environ.get('DISK_CHECK_LOG')
    if log_path is None:
        log_path = os.path.join(tempfile.gettempdir(), 'disk_check.log')
    log_line = f'{now} total={total} used={used} free={free}\n'
    with open(log_path, 'a') as f:
        f.write(log_line)

if __name__ == '__main__':
    main()

This script uses only the Python standard library, so it works without installing extra packages. It writes to a log file in the system temporary directory, which is normally writable by the user who runs the script. The customer can run it with a scheduled task, such as cron, to check disk space regularly. If the customer's security policy requires a different log location such as /var/log, the person running the script can set the DISK_CHECK_LOG environment variable to that path, provided they have write permission.

Handling constraints

Customers often have constraints that affect your code. Common ones are:

  • No internet access: use only libraries that are already installed or that you can copy onto the machine.
  • Limited permissions: the user running your code may not be able to write to certain folders or install software.
  • Old software versions: test your code on the same version the customer uses.
  • Security policies: the customer may require that all data stays on their machines, or that logs are reviewed.

When you hit a constraint, talk to the customer. Explain what you need and why. Often there is a workaround, such as running your code as a different user or changing the log location.

Keeping the customer's systems safe

Security is part of shipping. Your code should not make the customer's systems less safe. Follow these practices:

  • Validate all input. If your code reads a file or a network message, check that it is what you expect before using it.
  • Do not hard-code secrets like passwords or API keys. Read them from a configuration file or an environment variable that only the right users can read.
  • Use the least privilege needed. If your code only needs to read a file, do not ask for write access.
  • Keep your code simple. Fewer lines and fewer dependencies mean fewer places for bugs and security holes.

Here is a small change to the disk check script to show input validation. Suppose the script can take a path as a command-line argument. You want to make sure the path is a directory before using it.

import shutil
import datetime
import os
import sys
import tempfile

def main():
    if len(sys.argv) > 1:
        path = sys.argv[1]
    else:
        path = '/'
    if not os.path.isdir(path):
        print(f'Error: {path} is not a directory.')
        sys.exit(1)
    total, used, free = shutil.disk_usage(path)
    now = datetime.datetime.now().isoformat()
    log_path = os.environ.get('DISK_CHECK_LOG')
    if log_path is None:
        log_path = os.path.join(tempfile.gettempdir(), 'disk_check.log')
    log_line = f'{now} path={path} total={total} used={used} free={free}\n'
    with open(log_path, 'a') as f:
        f.write(log_line)

if __name__ == '__main__':
    main()

This version checks that the given path is a directory before calling disk_usage. If the path is not valid, it prints an error and stops. That prevents the script from crashing in a confusing way or writing bad data to the log. It also reads the DISK_CHECK_LOG environment variable, so you can point it to a writable location for testing or for a different customer requirement.

Testing before you ship

You cannot always test on the customer's machine, but you can test on a similar setup. Create a virtual machine or a container that matches the customer's operating system and software versions. Run your code there and check that it works.

Write a small test script for the disk check. Create a file called test_disk_check.py:

import subprocess
import sys
import tempfile
import os

def test_disk_check_with_valid_path():
    with tempfile.TemporaryDirectory() as tmpdir:
        log_file = os.path.join(tmpdir, 'disk_check.log')
        env = os.environ.copy()
        env['DISK_CHECK_LOG'] = log_file
        result = subprocess.run(
            [sys.executable, 'disk_check.py', tmpdir],
            capture_output=True,
            text=True,
            env=env
        )
        assert result.returncode == 0
        assert os.path.exists(log_file)

def test_disk_check_with_invalid_path():
    with tempfile.TemporaryDirectory() as tmpdir:
        log_file = os.path.join(tmpdir, 'disk_check.log')
        env = os.environ.copy()
        env['DISK_CHECK_LOG'] = log_file
        result = subprocess.run(
            [sys.executable, 'disk_check.py', '/no/such/path'],
            capture_output=True,
            text=True,
            env=env
        )
        assert result.returncode != 0
        assert 'Error' in result.stdout

This test runs the script with a temporary directory and sets DISK_CHECK_LOG to a file inside that directory. That avoids depending on permissions for any fixed system path. It checks that the script succeeds and writes the log file. It also runs the script with an invalid path and checks that it fails with an error message. You can run the tests with python -m pytest test_disk_check.py if you have pytest installed, or you can run the test functions manually.

Shipping and maintaining

Once your code works in the test environment, you move it to the customer's machine. This often means copying files, setting up a scheduled task, and writing a short document that explains how to run and stop the software.

After shipping, you keep in touch with the customer. Ask if the software is working as expected. Fix bugs quickly. When the customer's needs change, update the software and ship a new version.

Remember that shipping is not a one-time event. It is a cycle of listening, building, testing, and improving.

Key takeaways

  • Shipping as an FDE means getting your code running reliably inside a customer's existing systems.
  • Learn the customer's environment and constraints before you write code.
  • Use the language's standard library, writable locations, and simple, secure practices to fit into restricted environments.
  • Test on a setup that matches the customer's, then ship and maintain the software through ongoing communication.

Try it

Write a Python script called cpu_check.py that reads the current CPU usage on Linux from /proc/stat, calculates the percentage since the last run, and appends a line with the timestamp and percentage to a log file. Use an environment variable CPU_CHECK_LOG for the log path; if it is not set, default to a file in the system temporary directory using tempfile.gettempdir(). The script should accept an optional interval in seconds as a command-line argument, defaulting to 1 second, and validate that the interval is a positive number. Test the script on your own machine by running it a few times with different intervals and checking that the log file contains sensible values between 0 and 100. A good result is a script that runs without errors, writes correctly formatted log lines to the chosen writable path, and rejects invalid intervals with a clear error message.

Official documentation

Ready to use this in a job?

Rolebound applies to matching roles for you.

Start now

Written with AI and checked automatically. Tools change, so a command may behave differently in the version you install. Spotted a mistake? Tell us.

    Cookies on Rolebound

    We use necessary cookies to sign you in and keep the site working — those cannot be turned off. We would also like to set analytics and advertising cookies so we can see which pages help people get interviews and which adverts brought them here. Nothing optional is set unless you say yes, and you can change your mind at any time from “Cookie settings” in the footer. Read our Privacy Policy.

    Shipping in Someone Else's Systems | What a Forward Deployed Engineer Does and How to Become One | Rolebound