Skip to content

Commit a85131f

Browse files
committed
Fix trino deployments
1 parent c6cce42 commit a85131f

File tree

2 files changed

+39
-11
lines changed

2 files changed

+39
-11
lines changed

benchmarks/cdk/lib/cdk-stack.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,25 @@ export class CdkStack extends Stack {
8484
resources: ['*'],
8585
}));
8686

87+
// Grant Glue permissions for Trino Hive metastore
88+
role.addToPolicy(new iam.PolicyStatement({
89+
actions: [
90+
'glue:GetDatabase',
91+
'glue:GetDatabases',
92+
'glue:GetTable',
93+
'glue:GetTables',
94+
'glue:GetPartition',
95+
'glue:GetPartitions',
96+
'glue:CreateTable',
97+
'glue:UpdateTable',
98+
'glue:DeleteTable',
99+
'glue:CreateDatabase',
100+
'glue:UpdateDatabase',
101+
'glue:DeleteDatabase',
102+
],
103+
resources: ['*'],
104+
}));
105+
87106
// Grant read access to the bucket and worker binary
88107
bucket.grantRead(role);
89108
workerBinary.grantRead(role);
@@ -124,7 +143,7 @@ EOF`,
124143
'systemctl daemon-reload',
125144
'systemctl enable worker',
126145
'systemctl start worker',
127-
...trinoUserDataCommands(i)
146+
...trinoUserDataCommands(i, this.region)
128147
);
129148

130149
const instance = new ec2.Instance(this, `BenchmarkInstance${i}`, {

benchmarks/cdk/lib/trino.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
export function trinoUserDataCommands(instanceIndex: number): string[] {
1+
const TRINO_VERSION = 476
2+
3+
export function trinoUserDataCommands(instanceIndex: number, region: string): string[] {
24
const isCoordinator = instanceIndex === 0;
35

46
return [
5-
// Install Java 22 for Trino (Trino 461 requires Java 22+)
6-
'yum install -y java-22-amazon-corretto-headless python',
7+
// Install Java 24 for Trino (Trino 478 requires Java 24+)
8+
'yum install -y java-24-amazon-corretto-headless python',
79

8-
// Download and install Trino
10+
// Download and install Trino 478 (latest version)
911
'cd /opt',
10-
'curl -L -o trino-server.tar.gz https://repo1.maven.org/maven2/io/trino/trino-server/461/trino-server-461.tar.gz',
12+
`curl -L -o trino-server.tar.gz https://repo1.maven.org/maven2/io/trino/trino-server/${TRINO_VERSION}/trino-server-${TRINO_VERSION}.tar.gz`,
1113
'tar -xzf trino-server.tar.gz',
12-
'mv trino-server-461 trino-server',
14+
`mv trino-server-${TRINO_VERSION} trino-server`,
1315
'rm trino-server.tar.gz',
1416

1517
// Create Trino directories
@@ -49,15 +51,22 @@ http-server.http.port=8080
4951
discovery.uri=http://localhost:8080
5052
TRINO_EOF`,
5153

52-
// Configure Hive catalog for S3 Parquet files
54+
// Configure Hive catalog with AWS Glue metastore
5355
`cat > /opt/trino-server/etc/catalog/hive.properties << 'TRINO_EOF'
5456
connector.name=hive
55-
hive.metastore=file
56-
hive.metastore.catalog.dir=/var/trino/metastore
57+
hive.metastore=glue
58+
hive.metastore.glue.region=${region}
59+
fs.native-s3.enabled=true
60+
s3.region=${region}
61+
TRINO_EOF`,
62+
63+
// Configure TPCH catalog for reference
64+
`cat > /opt/trino-server/etc/catalog/tpch.properties << 'TRINO_EOF'
65+
connector.name=tpch
5766
TRINO_EOF`,
5867

5968
// Download Trino CLI
60-
'curl -L -o /usr/local/bin/trino https://repo1.maven.org/maven2/io/trino/trino-cli/461/trino-cli-461-executable.jar',
69+
'curl -L -o /usr/local/bin/trino https://repo1.maven.org/maven2/io/trino/trino-cli/478/trino-cli-478-executable.jar',
6170
'chmod +x /usr/local/bin/trino',
6271

6372
// Create Trino systemd service

0 commit comments

Comments
 (0)