AWS Marketplace Usage Instructions
This page serves as a comprehensive guide for setting up and installing Retable, a Unix-based application for data management. It outlines the system prerequisites, and installation steps for modules.
Contents
API Module
Socket Module
UI Module
AWS ECS Installation
Fargate
EC2
Introduction
Retable is designed to operate exclusively in UNIX environments. All commands provided here have been tested on Unix-based EC2 instances, regardless of the specific OS chosen.
The Retable application comprises three main modules: API, UI, and Socket. Ensure all prerequisites are met before starting the application. Note that the API module is resource-intensive and requires the most allocation. Therefore, allocate a larger portion of your resources to the API module. The sequence for starting the modules should begin with the API, which depends on PostgreSQL and Redis connections.
Prerequisites
Database
A running PostgreSQL Database (minimum version 13) is required. Based on the Retable App's API module usage, a minimum of 8 GB RAM and 2 CPU cores is recommended. You may need to increase the server specifications if necessary. The app uses two databases: one for meta-information and the other for storing table data.
Example database creation commands:
When the API module starts, it creates an admin user if one does not already exist. Set the admin email and password in the API environment file. This admin information is used to access the app and invite other users.
Specify database connection information (user, password, database names, port, etc.) in the environment file. More details are available in the API Module Environment File Section.
The API module requires TCP connection to the database server. Configure your security group to allow traffic between the API and the Database on the specified port.
Redis
A running Redis Server (minimum version 6) is needed for collaborative functionalities and scheduled automations.
Specify the connection information in the environment file. More details are available in the API Module Environment File Section.
The API module needs TCP connection to the Redis server. Configure your security group to allow traffic between the API and Redis on the specified port.
Attachments
To store attachments, set up an AWS S3 Bucket. The API module requires the Bucket Region, Access Key, and Bucket Name, which should be configured in the API environment file. Ensure that proper access permissions are set for the bucket. More information is available in the API Module Environment File section.
The attachment limit per file is 100MB. If you exceed this limit, please contact us.
Creating an S3 Bucket
First, create an S3 bucket by following these instructions. After creating the attachment bucket, you must create an IAM role to manage your uploads.
Creating an S3 Policy
Retable requires permissions to upload attachments to your S3 bucket. To grant access, you need to create an S3 policy. Follow these steps to create the policy:
Go to the IAM Service in the AWS Console, select Policies from the left pane, and click Create policy.
Select S3 as the service
Under Actions, specify the allowed actions. Use the Filter Actions search bar to find and select PutObject, GetObject, and DeleteObject.
Under Resources, click Add ARNs. In the modal that appears, enter your bucket name in the Resource bucket name field and select the Any object name checkbox. Then, click Add ARNs and close the modal.
Click Next to proceed. Give the policy a descriptive name and, optionally, a description.
Click Create Policy to finalize the process.
Creating an IAM S3 User
After creating an S3 policy, you need to attach it to an IAM user. Follow these steps to create the IAM user:
Go to the IAM Service and select Users under the IAM Resources section.
Click Create User. On the next page, enter a name for the IAM user (e.g., s3-user) and click Next.
In the Set Permissions section, choose Attach policies directly. Search for the policy you created earlier, select the checkbox next to it, and click Next.
Review the details, and if everything is correct, click Create User.
Creating an Access Key
To generate an access key for the newly created IAM user, follow these steps:
Open the IAM Service, click Users in the left pane, and select the newly created user from the list.
On the user details page, click Create access key.
Choose Application running on an AWS compute service and check the confirmation box.
Optionally, add a description tag, then click Create access key.
On the final page, copy the Access Key and Secret Access Key. Ensure that you store the Secret Access Key securely, as it will not be shown again.
These keys are required for the API module environment file:
AWS_BUCKET_UID: Your Access Key
AWS_BUCKET_PWD: Your Secret Access Key
E-Mails
An SMTP server is necessary for sending emails, which is crucial for inviting users to your app. Ensure that the SMTP server details are correctly configured.
Installation
Prepare your database: Ensure your PostgreSQL database is set up and ready. More information.
Create the environment file (
app_api_env
):Create a file named
app_api_env
in your project directory.Add the required environment variables in the format
KEY=VALUE
, each on a new line.
Api Module Environment File:
ADMIN_USER_EMAIL
Email address of the admin user. This user will be created automatically when Product run
ADMIN_USER_PASSWORD
Password of the admin user
AWS_ECS_REGION
AWS region where ECS task is running (e.g., eu-west-2)
DB_HOST
Hostname of the Postgres Database Server
DB_PORT
Port of the Database Server
DB_USER
Username of the Database User
DB_PWD
Password of the Database User
DB_SSL
Indicates whether SSL is enabled for the database connection (e.g., true or false)
REDIS_HOST
Hostname of the Redis Server
REDIS_PORT
Port number of the Redis Server
REDIS_PASSWORD
Password of the Redis Server
DB_SSL_CERT_PATH
File path to the SSL certificate used for secure database connections.
BASE_URL
SHARE_URL
[will be filled]
AWS_BUCKET_UID
Your AWS Access Key (change this naming)
AWS_BUCKET_PWD
Your AWS Secret Access Key (change this naming)
AWS_BUCKET_REGION
Your AWS S3 Bucket Region (ex: eu-west-1)
AWS_BUCKET_S3
Your AWS S3 Bucket name
META_BASE_URL
Base Endpoint to reach the API
Example format of the environment file:
Socket Module
Ensure your Redis is ready:
Create the environment file (
app_socket_env
):Create a file named
app_socket_env
in your project directory.Add the required environment variables to this file. Each variable should be on a new line in the format
KEY=VALUE
.
Socket Module Environment File:
REDIS_HOST
Hostname of the Redis
REDIS_PORT
Port number of the Redis Server
REDIS_PASSWORD
Password of the Redis Server
PORT
Port of your Socket Http & Websocket Server
META_API_BASE_ENDPOINT
Base URL of your Api Module
Example format of the environment file:
UI Module
Ensure your Api and Socket is ready:
Create the environment file (
app_ui_env
):Create a file named
app_ui_env
in your project directory.Add the required environment variables to this file. Each variable should be on a new line in the format
KEY=VALUE
.
UI Module Environment File:
REACT_APP_API_PATH
Api Module Base Enpdoint
REACT_APP_BASE_URL
Base URL that you access your application
REACT_APP_SHARE_URL
Same with the REACT_APP_BASE_URL
REACT_APP_SOCKET_PATH
Socket Module Base Endpoint
Example format of the environment file:
After creating these environment files, upload them to an S3 bucket. They will be required for the environmentFiles field when defining an ECS Task Definition.
AWS Elastic Container Service (ECS) Installation
Hereβs how to get started with ECS Anywhere. You first create a new Amazon ECS cluster with two external worker nodes by installing Amazon ECS agents, System Manager agents, and Docker on virtual machines (VMs). Second, you create an Amazon S3 bucket to store input and output files for the ECS task and attachment files. Finally, you create AWS Identity and Access Management (IAM) roles with appropriate permissions and task definitions. This is to deploy AWS Marketplace container product on created ECS Anywhere cluster with a external worker node.
Subscribe to Retable product. This will incur software costs to your AWS account. You can review the product pricing at Retable β Pricing before subscribing.
Create IAM role.
Create Task definition.
Create Amazon ECS cluster and run the task definition on that Amazon ECS cluster.
Attention: Pre-install the following tools on remote node:
Curl
Solution walkthrough
This solution walkthrough has the following steps:
Prepare the AWS resources.
Prepare the infrastructure node.
Deploy the container product.
Step 1: Prepare the AWS resources
In this step, you create an ECS Anywhere cluster to host the remote node and the required AWS IAM roles for the remote node and executing tasks.
A. Create an ECS Anywhere cluster using AWS CLI
To create an ECS Anywhere cluster, execute this command in your CLI:
You should receive output similar to the following:
B. Create an IAM role
Create a required IAM role βecsAnywhereRole
β for remote instances by following the instructions in IAM permissions for Amazon ECS Anywhere or the following steps:
Open the IAM console at https://console.aws.amazon.com/iam/. In the navigation pane, choose Roles and then choose Create role.
Choose the AWS service role type, and then choose Systems Manager. Choose the Systems Manager use case and then Next: Permissions.
In the permissions policy section, search for and select the AmazonSSMManagedInstanceCore and AmazonEC2ContainerServiceforEC2Role policies and then choose Next: Review.
For Add tags (optional), specify any custom tags to associate with the policy and then choose Next: Review.
For Role name, enter ECSAnywhereRole and optionally you can edit the description. Review your role information and then choose Create role.
Perform a search for the ECSAnywhereRole and then select it to view the role details.
On the Permissions tab, make sure that AmazonSSMManagedInstanceCore policy is added.
Step 2: Prepare the infrastructure node
In this walkthrough, you use a virtual machine running your managed infrastructure. You can use any type of infrastructure that can run any of the operating systems supported by ECS Anywhere. This may include a physical, on-premises server.
A. Register your virtual machines
You can follow the instructions to learn more about how to register an external instance to an AWS ESC cluster. Alternately, to register virtual machine using the AWS Management Console, perform the following instructions:
Open the Amazon ECS console.
From the navigation bar, select the Region to use.
In the navigation pane, choose Clusters.
On the Clusters page, choose retable-ecs-cluster to register your external instance to.
Choose the Infastructure tab, then choose Register external instances on the Container Instances section.
On the Step 1: External instances activation details page, complete the following steps.
For Activation key duration (in days), enter the number of days that the activation key remains active. After the number of days you entered passes, the key no longer works when registering an external instance.
For Number of instances, enter the number of external instances that you want to register to your cluster with the activation key.
For Instance role, choose the IAM role to associate with your external instances. We will use the IAM role
ecsAnywhereRole
created in previous step.Choose Generate registration command.
You should see a command similar to this:
curl --proto "https" -o "/tmp/ecs-anywhere-install.sh" "https://amazon-ecs-agent.s3.amazonaws.com/ecs-anywhere-install-latest.sh" && bash /tmp/ecs-anywhere-install.sh --region "us-east-1" --cluster "retable-ecs-cluster" --activation-id "<activation_id>" --activation-code "<activation_code>"
Copy the generated registration command then run this command on your virtual machine that you prepared.
B. Verify the ECS agent is running on virtual machine
Once the installation completed, to verify if the ECS agent is running on virtual machine, run the following command in your virtual machineβs console.
You should receive output similar to the following example output:
On the AWS Management Console, navigate to the Infrastructure tab. Your remote instance should appear on the Container instances section.
A. Set up required IAM role for executing ECS task
Create ecsTaskExecutionRole by following the instructions at Creating the task execution IAM role.
B. Attach the required permissions
Metering Usage policy
Attach the AWSMarketplaceMeteringFullAccess managed policy to the IAM role ecsTaskExecutionRole by running the following command in CLI:
S3 Get Policy
Attach the AmazonS3ReadOnlyAccess managed policy to the IAM role ecsTaskExecutionRole by running the following command in CLI:
Metering Usage
C. Create ECS task definition file to deploy the container product on your ECS Anywhere cluster
See Retable's usage instructions for more information on the command arguments being passed to the container.
Create a task definition file.
To create an task definition for ECS Anywhere save this as file called AWSMP-Retable-task-execution.json replacing <aws-account-id> with your actual AWS account ID and <bucket-name> with the name you chose for the environment files. You can follow the instructions here to find your AWS Account ID.
The requiresCompatibilities value must be EXTERNAL to allow the task to be deployed on external instances.
Register the task definition to your AWS account. To do that, enter the following command in your terminal:
Run the registered task definition using the following command in your terminal:
You can monitor the progress in the Amazon ECS console until it runs successfully.
Last updated