Skip to content

Commit

Permalink
changed id names in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwcfan committed Sep 11, 2024
1 parent eee6f1f commit 5641f94
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
20 changes: 8 additions & 12 deletions frontend/src/pages/deployment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ function AgentRow({ bearer, initial_data, openRunAgentModal, setSelectedAgentId
name="FeatherTerminalSquare"
/>
<span className="whitespace-nowrap text-body-bold font-body-bold text-default-font">
{agent.name}
{agent.id}
</span>
</div>
</Table.Cell>
<Table.Cell>
<span className="whitespace-nowrap text-body font-body text-neutral-500">
{agent.name}
</span>
</Table.Cell>
<Table.Cell>
<SubframeCore.Tooltip.Provider>
<SubframeCore.Tooltip.Root>
Expand Down Expand Up @@ -103,15 +108,6 @@ function AgentRow({ bearer, initial_data, openRunAgentModal, setSelectedAgentId
1.8s
</span>
</Table.Cell>
<Table.Cell>
<SubframeCore.Icon
className="text-body font-body text-subtext-color"
name="FeatherUser"
/>
<span className="whitespace-nowrap text-body font-body text-neutral-500">
{agent.id}
</span>
</Table.Cell>
<Table.Cell>
<SubframeCore.DropdownMenu.Root>
<SubframeCore.DropdownMenu.Trigger asChild={true}>
Expand Down Expand Up @@ -230,10 +226,10 @@ export function DeploymentPage() {
header={
<Table.HeaderRow>
<Table.HeaderCell />
<Table.HeaderCell>Agent Name</Table.HeaderCell>
<Table.HeaderCell>Agent ID</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell>Status</Table.HeaderCell>
<Table.HeaderCell>Created Date</Table.HeaderCell>
<Table.HeaderCell>Agent ID</Table.HeaderCell>
<Table.HeaderCell>-</Table.HeaderCell>
</Table.HeaderRow>
}
Expand Down
6 changes: 3 additions & 3 deletions server/agent_deployer/agent_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def get_agent_upload_link(
) -> str:

bucket = self.storage_client.get_bucket(self.deployments_bucket)
blob = bucket.blob(f"{agent.id}.zip")
blob = bucket.blob(f"{agent.finic_id}.zip")
url = blob.generate_signed_url(
version="v4",
expiration=timedelta(minutes=expiration_minutes),
Expand Down Expand Up @@ -61,7 +61,7 @@ async def deploy_agent(self, agent: Agent):
source=cloudbuild_v1.Source(
storage_source=cloudbuild_v1.StorageSource(
bucket=self.deployments_bucket,
object_=f"{agent.id}.zip",
object_=f"{agent.finic_id}.zip",
)
),
)
Expand All @@ -74,7 +74,7 @@ async def deploy_agent(self, agent: Agent):
if result.status != cloudbuild_v1.Build.Status.SUCCESS:
raise Exception(f"Build failed with status: {result.status}")

print(f"Built and pushed Docker image: {agent.id}")
print(f"Built and pushed Docker image: {agent.finic_id}")

def _get_build_config(self, job: Agent, job_exists: bool) -> dict:
image_name = f"gcr.io/{self.project_id}/{job.id}:latest"
Expand Down
4 changes: 2 additions & 2 deletions server/agent_runner/agent_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def start_agent(self, agent: Agent, input: Dict) -> Execution:
{"name": "FINIC_ENV", "value": FinicEnvironment.PROD.value},
{"name": "FINIC_INPUT", "value": json.dumps(input)},
{"name": "FINIC_API_KEY", "value": secret_key},
{"name": "FINIC_AGENT_ID", "value": agent.id},
{"name": "FINIC_AGENT_ID", "value": agent.finic_id},
]
}
]
Expand All @@ -65,7 +65,7 @@ async def start_agent(self, agent: Agent, input: Dict) -> Execution:
print(f"Started execution: {execution_id}")
return Execution(
id=str(uuid.uuid4()),
agent_id=agent.id,
finic_agent_id=agent.finic_id,
app_id=agent.app_id,
cloud_provider_id=execution_id,
status=ExecutionStatus.running,
Expand Down
4 changes: 2 additions & 2 deletions server/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ class Agent(BaseModel):

@staticmethod
def get_cloud_job_id(agent: "Agent") -> str:
return f"agent-{agent.id}"
return f"job-{agent.finic_id}"


class Execution(BaseModel):
id: str
agent_id: str
finic_agent_id: str
app_id: str
cloud_provider_id: str
status: ExecutionStatus
Expand Down
4 changes: 2 additions & 2 deletions server/server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async def get_execution(
try:
agent = await db.get_agent(config=config, id=agent_id)
execution = await db.get_execution(
config=config, agent_id=agent.id, execution_id=execution_id
config=config, agent_id=agent.finic_id, execution_id=execution_id
)
return execution
except Exception as e:
Expand All @@ -217,7 +217,7 @@ async def list_executions(
):
try:
agent = await db.get_agent(config=config, id=agent_id)
executions = await db.list_executions(config=config, agent_id=agent.id)
executions = await db.list_executions(config=config, agent_id=agent.finic_id)
return executions
except Exception as e:
print(e)
Expand Down

0 comments on commit 5641f94

Please sign in to comment.