Skip to content

Commit 33c5f04

Browse files
committed
use larger tmp
1 parent 1b927d5 commit 33c5f04

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

servers/fai-lambda-deploy/scripts/fai-scribe-stack.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type EnvironmentInfo, EnvironmentType } from "@fern-fern/fern-cloud-sdk/api";
2-
import { CfnOutput, Duration, RemovalPolicy, Stack, type StackProps } from "aws-cdk-lib";
2+
import { CfnOutput, Duration, RemovalPolicy, Size, Stack, type StackProps } from "aws-cdk-lib";
33
import * as apigateway from "aws-cdk-lib/aws-apigateway";
44
import { Certificate } from "aws-cdk-lib/aws-certificatemanager";
55
import * as ec2 from "aws-cdk-lib/aws-ec2";
@@ -110,6 +110,7 @@ export class FaiScribeStack extends Stack {
110110
}),
111111
timeout: Duration.minutes(15),
112112
memorySize: 512,
113+
ephemeralStorageSize: Size.mebibytes(2048),
113114
logGroup,
114115
vpc: this.vpc,
115116
vpcSubnets: {

servers/fai-lambda/shared/utils/git.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def cleanup_old_sessions(base_path: Path, max_age_hours: int = 24) -> None:
2929

3030

3131
def clone_repo(repository: str, session_id: str, session_type: str = "session") -> str:
32-
"""Clone a GitHub repository into EFS storage.
32+
"""Clone a GitHub repository into /tmp with aggressive cleanup.
3333
3434
Args:
3535
repository: GitHub repository in format 'owner/repo'
@@ -43,13 +43,12 @@ def clone_repo(repository: str, session_id: str, session_type: str = "session")
4343
if not github_token:
4444
raise RuntimeError("GITHUB_TOKEN environment variable not set")
4545

46-
base_path = Path(os.environ.get("HOME", "/mnt/efs")) / "repos"
46+
base_path = Path("/tmp")
4747
session_path = base_path / f"{session_type}-{session_id}" / repository
4848

49-
base_path.mkdir(parents=True, exist_ok=True)
50-
session_path.parent.mkdir(parents=True, exist_ok=True)
49+
cleanup_old_sessions(base_path, max_age_hours=1)
5150

52-
cleanup_old_sessions(base_path)
51+
session_path.parent.mkdir(parents=True, exist_ok=True)
5352

5453
if session_path.exists():
5554
logger.info(f"Removing existing session path: {session_path}")

0 commit comments

Comments
 (0)