Skip to main content

Pack and Send

Prerequisites

  1. Install Node.js version 18.x LTS
  2. Install si Scramjet's Command Line Interface

For the Sequence deployment on Scramjet's Transform Hub (STH) or the Cloud Platform (SCP), the script and all its dependencies packed in a tar.gz format before being uploaded. One or multiple files might be required to be in the same directory of the Sequence folder. The below points are the essential structural components of a Sequence to run on STH.

Required Sequence files

  • index.js - The main file with the user's logic

  • Files - In case the user's Sequence requires any additional files it is mandatory to add those files to the same directory alongside the rest of requirements

  • Dependencies - All dependencies that are needed to execute the Sequence. Dependencies must be in the same directory alongside the rest of required files which will be packed as a Sequence

  • package.json - The manifest file that describes this particular Sequence
  • To create a package.json file with the values that you supply, use the following command-line
    npm init - creates a new package.json file with elementary properties. Contains prompts about the project , such as the name, version, etc. for more information on package.json. A brief illustration is shown in the below section.

    {
    "name": "SequenceName",
    "version": "0.23.0",
    "main": "./index",
    "author": "USER",
    "license": "GPL-3.0",
    "description": "what is it about",
    "keywords": [
    "data transformation",
    "Data Transformer"
    ],
    "repository": {
    "type": "git",
    "url": "https://github.com/"
    },
    "engines": {
    "node": "^18.0.0"
    },
    "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "tsc -p tsconfig.json",
    "postbuild": "cp -r package.json dist/ && (cd dist && npm i --only=production) && cp src/utils/song.wav dist/utils && cp src/utils/config.json dist/utils ",
    "pack": "si seq pack ./dist/",
    "clean": "rm -rf ./dist ./*.tar.gz"
    },
    "assets": [
    "song.wav"
    ],
    "dependencies": {
    "@scramjet/utility": "^0.33.5",
    "@types/node": "^18.16.2",
    "axios": "^1.3.6",
    "date-and-time": "^2.4.3",
    "typescript": "^5.0.4"
    }
    }

Pack a Sequence

  1. A Sequence can be packed manually in the form of a tar.gz file before being sent to STH through the command-line:

    si sequence pack <path/to/Sequence/folder> 
  2. To send the packed Sequence to Scramjet's Transform Hub or Cloud Platform:

    si sequence send <path/to/filename.tar.gz> --progress

Alternatively, the Sequence can be deploy (pack, send and run) on STH or SCP through the command-line:

si sequence deploy|run [options] <path/to/Sequence/folder>
info

In the case of TypeScript, after transpiling deploy command should point out to the ./dist folder path

si sequence deploy|run [options] <path/to/folder/dist>
  • Check out Scramjet's Command lines Interface (CLI) section
  • GitHub logo Visit Scramjet's platform-samples GitHub repository for more examples of Sequences
  • Was it helpful?

    Didn't find information needed?

    Join our Scramjet Community on Discord, where you can get help from our engineers directly.