Skip to main content

Julia 1.12 High-Performance Data Science Environment (CentOS Stream 9) AMI Administrator Guide

1. Quick Start Information

Install Information:

  • OS: CentOS Stream 9
  • Julia version: 1.12.4 (Latest Stable)
  • Julia Install Directory: /usr/local/julia/
  • Pre-installed Packages: DataFrames, CSV, JSON, HTTP, Plots

Connection Methods:

  • Access the instance via SSH using the ec2-user user.
  • Use sudo to run commands requiring root privileges.

Verify Installation:

  • Check Julia version: julia --version
  • Check threads: julia -e 'println(Threads.nthreads())'

Julia Service Management:

  • Start Julia REPL: julia
  • Run a script: julia script.jl
  • Exit REPL: Press Ctrl+D or type exit()

Firewall Configuration:

  • Please allow SSH port 22.
  • For security, it is recommended to limit SSH access to trusted IPs only.

Important Note:

  • Pre-installed packages are optimized and configured specifically for the default ec2-user. Please run your Julia scripts as ec2-user to utilize the ready-to-use environment.

2. Overview

Welcome to the Easycloud Julia High-Performance Data Science Environment AMI. This image is based on CentOS Stream 9 and provides a production-ready Julia environment with pre-compiled data science libraries.

Core Features of this AMI:

  • Multithreading Enabled: Pre-configured with JULIA_NUM_THREADS=auto to automatically utilize all available CPU cores.
  • Pre-compiled Libraries: DataFrames, Plots, and other heavy libraries are pre-compiled, eliminating the "first-time-to-plot" delay.
  • Batteries Included: Data Science Stack (DataFrames, CSV, JSON, HTTP, Plots) ready to use.
  • Latest Stable Version: Julia 1.12.4 from official releases, not outdated repository versions.
  • Standard Path: Installed in /usr/local following Linux FHS standards.

Why This AMI is Different:

ProblemTraditional InstallationThis AMI
Multi-threadingSingle-threaded by default (wasted CPU cores)Auto-detects and uses all CPU cores
First-time delay5-10 minutes compiling on first usePre-compiled, ready in seconds
Package installationManual download and compileCore packages pre-installed
VersionOld versions from yum/dnf reposLatest stable 1.12.4

Target Scenarios:

  • Data science and analytics workloads
  • Scientific computing and numerical analysis
  • Machine learning prototyping
  • High-performance computing on cloud instances

3. First Launch & Access

Step 1: Configure Security Group (Cloud Firewall)

In your cloud provider's console (e.g., AWS EC2), add inbound rules to the security group for this instance to allow:

  • TCP Port 22 (SSH): Required for server access (Mandatory).

Security Recommendation:

  • Restrict SSH access to your office IP address or VPN subnet only.
  • Avoid opening SSH to 0.0.0.0/0 (the entire internet) in production environments.

Step 2: Connect via SSH

  1. Get your instance's public IP address from the cloud console.
  2. Use your SSH client to connect:
    ssh ec2-user@[Your_Public_IP]
  3. If prompted about host authenticity, type yes to continue.

Step 3: Verify Installation

After logging in, run the following commands to verify the environment is ready:

Check Julia Version:

julia --version

Expected output: julia version 1.12.4

Verify Multi-threading and Pre-compiled Libraries:

time julia -e 'using DataFrames; println("Threads: ", Threads.nthreads()); println("System Ready!")'

Expected output:

Threads: 2  (or more, depending on instance CPU cores)
System Ready!

real 0m1.107s (should be just a few seconds, not minutes)

Enter Julia REPL:

julia

You will see:

               _
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.12.4 (2026-01-06)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org release
|__/ |

julia>

Press Ctrl+C or Ctrl+D to exit.


4. AMI Detailed Configuration & Architecture

This AMI has been configured with a complete Julia data science environment. All installations follow Linux FHS (Filesystem Hierarchy Standard) conventions.

Installation Architecture:

/usr/local/julia/      <- Julia installation directory
├── bin/julia <- Julia binary
├── lib/ <- Core libraries
└── share/ <- Documentation and resources

/usr/bin/julia <- Symlink to Julia binary (global command)

/etc/profile.d/julia_tuning.sh <- System-wide performance configuration
(JULIA_NUM_THREADS=auto, JULIA_EDITOR=vim)

/home/ec2-user/.julia/ <- Pre-compiled packages (ec2-user only)
├── packages/ <- Downloaded package source
├── compiled/ <- Pre-compiled binaries (the VALUE ADD)
└── environments/ <- Package environments

4.1. Julia Compiler Installation

Paths

PathTypeDescription
/usr/local/julia/DirectoryJulia installation directory (official binary package)
/usr/local/julia/bin/juliaFileThe actual Julia binary
/usr/bin/juliaSymlinkPoints to Julia binary, enables global julia command
/etc/profile.d/julia_tuning.shFileSystem-wide performance configuration

Configuration (How-To-Create)

The following steps were performed to install Julia 1.12.4:

# 1. Update system and install prerequisites
sudo dnf update -y
sudo dnf install -y wget tar git unzip which

# 2. Download and install Julia 1.12.4 (official binary package)
# Install to /usr/local to ensure availability for all users
wget https://julialang-s3.julialang.org/bin/linux/x64/1.12/julia-1.12.4-linux-x86_64.tar.gz
sudo tar zxvf julia-1.12.4-linux-x86_64.tar.gz -C /usr/local/

# 3. Rename directory (standardize path)
# Rename the versioned folder to a clean 'julia' name
cd /usr/local/
sudo mv julia-1.12.4/ julia

# 4. Create global symlink
sudo ln -sf /usr/local/julia/bin/julia /usr/bin/julia

# 5. Verify installation
julia --version
# Expected output: julia version 1.12.4

Why This Configuration

  • Official Binary: Using official pre-compiled binaries ensures optimal performance and avoids compilation issues.
  • Symlink Strategy: Creating a symlink in /usr/bin/ ensures the julia command is available system-wide.
  • Standard Location: /usr/local/ is the standard location for locally installed software.

4.2. Performance Configuration (Multi-Threading)

Path

/etc/profile.d/julia_tuning.sh

File Content

(This file is automatically sourced for all users at login)

export JULIA_NUM_THREADS=auto
export JULIA_EDITOR=vim

Configuration (How-To-Create)

# Create system-level performance configuration
# Auto-detect CPU cores for multi-threading, set vim as default editor
echo 'export JULIA_NUM_THREADS=auto' | sudo tee /etc/profile.d/julia_tuning.sh
echo 'export JULIA_EDITOR=vim' | sudo tee -a /etc/profile.d/julia_tuning.sh
sudo chmod +x /etc/profile.d/julia_tuning.sh

# Apply changes to current session
source /etc/profile.d/julia_tuning.sh

How This Works

  • JULIA_NUM_THREADS=auto: Julia automatically detects and uses all available CPU cores. On a 2-core instance, Julia uses 2 threads. On a 64-core instance, Julia uses 64 threads.
  • /etc/profile.d/: Files in this directory are sourced for all users (including root) at login, making the configuration system-wide.
  • Cloud-Native Ready: Users get maximum performance from their EC2 instance without any configuration.

4.3. Pre-installed Packages (ec2-user)

Path

/home/ec2-user/.julia/

Pre-installed Packages

PackagePurpose
DataFramesTabular data manipulation (like pandas in Python)
CSVRead/write CSV files
JSONParse and generate JSON data
HTTPHTTP client for API calls
PlotsData visualization and plotting

Configuration (How-To-Create)

# Run as ec2-user (not root!)
# su - ec2-user

# Install and pre-compile core data science packages
julia -e '
import Pkg;
print("Starting Package Installation...\n");

# Install core libraries (data processing + networking + plotting)
Pkg.add(["DataFrames", "CSV", "JSON", "HTTP", "Plots"]);

print("Precompiling... (This is the Value Add!)\n");
Pkg.precompile();

print("All Done! System Ready.\n");
'

Why Pre-compilation Matters

The Problem: Julia's "First-Time-to-Plot" is notoriously slow. When a user first runs using Plots, Julia compiles the package from scratch, taking 5-10 minutes.

The Solution: By running Pkg.precompile() during AMI creation, all compilation is done beforehand. Users experience instant startup.

Performance Comparison:

ScenarioWithout Pre-compileWith Pre-compile (This AMI)
First using DataFrames30-60 seconds~1 second
First using Plots5-10 minutes~2 seconds

5. User Access Levels

Important: Package Availability by User

Pre-installed packages are configured specifically for ec2-user. Different users have different access levels:

Featureec2-user (Default)RootNew Users (e.g., bob)
Run JuliaYesYesYes
Standard LibraryYesYesYes
Multi-threadingYes (auto)Yes (auto)Yes (auto)
Pre-installed PackagesYes (instant)No (must install)No (must install)
Pre-compiled CacheYesNoNo

Root User Environment

Root has a "bare metal" Julia environment:

  • Can use: Julia interpreter, standard library (LinearAlgebra, Statistics, Dates, etc.), multi-threading
  • Cannot use: Pre-installed packages (DataFrames, Plots, etc.) without installing them
# Root CAN do this (standard library):
julia> using LinearAlgebra, Statistics, Dates
julia> rand(3,3) * rand(3,3) # Matrix multiplication works!

# Root CANNOT do this without installing:
julia> using DataFrames # ERROR: Package DataFrames not found

Recommendation

Always run Julia scripts as ec2-user to utilize the pre-compiled environment:

# Good - uses pre-compiled packages
ssh ec2-user@server
julia script.jl

# Not recommended - packages not available
sudo julia script.jl

6. Service Management (Quick Reference)

Julia is an interpreter, not a service. Here are the key commands:

Basic Julia Commands:

  • Start Julia REPL: julia
  • Run a script: julia script.jl
  • Run with specific threads: julia -t 4 script.jl
  • Check version: julia --version or julia -v
  • Exit REPL: Ctrl+D or exit()

Package Management (in Julia REPL):

  • Enter package mode: Press ]
  • Exit package mode: Press Backspace
  • List installed packages: ] status
  • Add a package: ] add PackageName
  • Update all packages: ] update

Environment Variables:

  • Check thread count: julia -e 'println(Threads.nthreads())'
  • Override threads: JULIA_NUM_THREADS=4 julia

7. Important File Locations

File PathPurpose
/usr/local/julia/Julia installation directory
/usr/local/julia/bin/juliaJulia binary
/usr/bin/juliaGlobal symlink to Julia
/etc/profile.d/julia_tuning.shSystem-wide performance configuration (multi-threading)
/home/ec2-user/.julia/Pre-installed packages and compiled cache (ec2-user only)
/home/ec2-user/.julia/packages/Downloaded package source code
/home/ec2-user/.julia/compiled/Pre-compiled binaries (the value add)

8. Troubleshooting

Problem: julia command not found

Symptom: Running julia returns "command not found".

Solution: The symlink may be missing. Recreate it:

sudo ln -sf /usr/local/julia/bin/julia /usr/bin/julia

Problem: Package not found (as root)

Symptom: Running using DataFrames as root returns:

ERROR: ArgumentError: Package DataFrames not found

Cause: Pre-installed packages are only available for ec2-user.

Solution: Either:

  1. Switch to ec2-user: su - ec2-user
  2. Or install the package for root: julia -e 'import Pkg; Pkg.add("DataFrames")'

Problem: Only 1 thread despite multi-core instance

Symptom: Threads.nthreads() returns 1.

Possible Causes:

  1. Environment not loaded: The configuration file wasn't sourced.

    source /etc/profile.d/julia_tuning.sh
    julia -e 'println(Threads.nthreads())'
  2. Configuration file missing:

    cat /etc/profile.d/julia_tuning.sh

    If missing, recreate it:

    echo 'export JULIA_NUM_THREADS=auto' | sudo tee /etc/profile.d/julia_tuning.sh
    sudo chmod +x /etc/profile.d/julia_tuning.sh

Problem: Slow first-time package loading

Symptom: using DataFrames takes 30+ seconds.

Possible Causes:

  1. Wrong user: You may be logged in as root or another user. Switch to ec2-user.
  2. Corrupted cache: The compiled cache may be corrupted.
    # As ec2-user, rebuild the cache
    julia -e 'import Pkg; Pkg.precompile()'

Problem: Permission denied errors

Symptom: Julia shows "Permission denied" when loading packages.

Cause: Usually caused by running sudo julia which creates root-owned files in ~/.julia.

Solution:

# Fix ownership of .julia directory
sudo chown -R ec2-user:ec2-user /home/ec2-user/.julia

Problem: Out of memory during compilation

Symptom: Julia crashes or hangs during package operations.

Cause: Insufficient RAM for compilation (especially for Plots).

Solution: Use a larger instance type (t3.small or larger with 2GB+ RAM) for heavy compilation tasks.


9. Advanced Topics

9.1. Adding More Packages

To install additional packages (as ec2-user):

# Start Julia
julia

# Enter package mode
]

# Add packages
add Statistics LinearAlgebra Distributions

# Exit package mode
# (press Backspace)

# Pre-compile for faster future loads
import Pkg; Pkg.precompile()

9.2. Creating a Jupyter Environment

To add Jupyter notebook support:

# As ec2-user
julia -e 'import Pkg; Pkg.add("IJulia")'

# This installs Jupyter kernel for Julia

9.3. GPU Computing (Optional)

For GPU-enabled instances (p3, g4, etc.):

# Install CUDA support
import Pkg
Pkg.add("CUDA")

# Verify GPU access
using CUDA
CUDA.functional() # Should return true

9.4. Upgrading Julia

To upgrade to a newer Julia version:

# 1. Download new version
wget https://julialang-s3.julialang.org/bin/linux/x64/1.XX/julia-1.XX.X-linux-x86_64.tar.gz

# 2. Remove old installation
sudo rm -rf /usr/local/julia

# 3. Extract new version
sudo tar zxvf julia-1.XX.X-linux-x86_64.tar.gz -C /usr/local/

# 4. Rename to standard path
cd /usr/local/
sudo mv julia-1.XX.X/ julia

# 5. Symlink remains valid (points to /usr/local/julia/bin/julia)

# 6. Verify
julia --version

Note: After upgrading Julia, packages may need to be reinstalled or recompiled.


10. Final Notes

This AMI provides a production-ready Julia data science environment with the following key benefits:

Key Takeaways:

  • Latest stable Julia 1.12.4 with automatic multi-threading
  • Pre-compiled data science stack (DataFrames, CSV, JSON, HTTP, Plots)
  • Zero-wait startup - no first-time compilation delay
  • Cloud-native performance optimization

For support or questions, please contact the Easycloud team.