Skip to content

Commit

Permalink
draft pulumi scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rchan26 committed Jun 13, 2024
1 parent 55c9f3d commit bfd56ee
Showing 1 changed file with 71 additions and 19 deletions.
90 changes: 71 additions & 19 deletions azure/production/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@
containers=[
# api-bot container
containerinstance.ContainerArgs(
image="ghcr.io/alan-turing-institute/reginald_slackbot:main",
image="ghcr.io/alan-turing-institute/reginald_slackbot:pulumi-reg-2pt0-update",
name="reginald-production", # maximum of 63 characters
environment_variables=[
containerinstance.EnvironmentVariableArgs(
name="REGINALD_MODEL",
value="llama-index-llama-cpp",
),
containerinstance.EnvironmentVariableArgs(
name="SLACK_APP_TOKEN",
secure_value=config.get_secret("REGINALD_SLACK_APP_TOKEN"),
Expand Down Expand Up @@ -139,8 +143,8 @@
containers=[
# all_data index creation container
containerinstance.ContainerArgs(
image="ghcr.io/alan-turing-institute/reginald_create_index:main",
name="reginald-create-index", # maximum of 63 characters
image="ghcr.io/alan-turing-institute/reginald_create_index:pulumi-reg-2pt0-update",
name="reginald-create-index-all-data", # maximum of 63 characters
environment_variables=[
containerinstance.EnvironmentVariableArgs(
name="GITHUB_TOKEN",
Expand All @@ -152,30 +156,30 @@
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_MAX_INPUT_SIZE",
value=DEFAULT_ARGS["max_input_size"],
value=str(DEFAULT_ARGS["max_input_size"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_K",
value=DEFAULT_ARGS["k"],
value=str(DEFAULT_ARGS["k"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_CHUNK_SIZE",
value=DEFAULT_ARGS["chunk_size"],
value=str(DEFAULT_ARGS["chunk_size"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_CHUNK_OVERLAP_RATIO",
value=DEFAULT_ARGS["chunk_overlap_ratio"],
value=str(DEFAULT_ARGS["chunk_overlap_ratio"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_NUM_OUTPUT",
value=DEFAULT_ARGS["num_output"],
value=str(DEFAULT_ARGS["num_output"]),
),
],
ports=[],
resources=containerinstance.ResourceRequirementsArgs(
requests=containerinstance.ResourceRequestsArgs(
cpu=2,
memory_in_gb=16,
memory_in_gb=8,
),
),
volume_mounts=[
Expand All @@ -187,8 +191,8 @@
),
# reg index creation container
containerinstance.ContainerArgs(
image="ghcr.io/alan-turing-institute/reginald_create_index:main",
name="reginald-create-index", # maximum of 63 characters
image="ghcr.io/alan-turing-institute/reginald_create_index:pulumi-reg-2pt0-update",
name="reginald-create-index-reg", # maximum of 63 characters
environment_variables=[
containerinstance.EnvironmentVariableArgs(
name="GITHUB_TOKEN",
Expand All @@ -200,30 +204,78 @@
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_MAX_INPUT_SIZE",
value=DEFAULT_ARGS["max_input_size"],
value=str(DEFAULT_ARGS["max_input_size"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_K",
value=DEFAULT_ARGS["k"],
value=str(DEFAULT_ARGS["k"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_CHUNK_SIZE",
value=DEFAULT_ARGS["chunk_size"],
value=str(DEFAULT_ARGS["chunk_size"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_CHUNK_OVERLAP_RATIO",
value=DEFAULT_ARGS["chunk_overlap_ratio"],
value=str(DEFAULT_ARGS["chunk_overlap_ratio"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_NUM_OUTPUT",
value=DEFAULT_ARGS["num_output"],
value=str(DEFAULT_ARGS["num_output"]),
),
],
ports=[],
resources=containerinstance.ResourceRequirementsArgs(
requests=containerinstance.ResourceRequestsArgs(
cpu=2,
memory_in_gb=16,
cpu=1,
memory_in_gb=4,
),
),
volume_mounts=[
containerinstance.VolumeMountArgs(
mount_path="/app/data",
name="llama-data",
),
],
),
# public index creation container
containerinstance.ContainerArgs(
image="ghcr.io/alan-turing-institute/reginald_create_index:pulumi-reg-2pt0-update",
name="reginald-create-index-public", # maximum of 63 characters
environment_variables=[
containerinstance.EnvironmentVariableArgs(
name="GITHUB_TOKEN",
secure_value=config.get_secret("GITHUB_TOKEN"),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_WHICH_INDEX",
value="public",
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_MAX_INPUT_SIZE",
value=str(DEFAULT_ARGS["max_input_size"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_K",
value=str(DEFAULT_ARGS["k"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_CHUNK_SIZE",
value=str(DEFAULT_ARGS["chunk_size"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_CHUNK_OVERLAP_RATIO",
value=str(DEFAULT_ARGS["chunk_overlap_ratio"]),
),
containerinstance.EnvironmentVariableArgs(
name="LLAMA_INDEX_NUM_OUTPUT",
value=str(DEFAULT_ARGS["num_output"]),
),
],
ports=[],
resources=containerinstance.ResourceRequirementsArgs(
requests=containerinstance.ResourceRequestsArgs(
cpu=1,
memory_in_gb=4,
),
),
volume_mounts=[
Expand All @@ -236,7 +288,7 @@
],
os_type=containerinstance.OperatingSystemTypes.LINUX,
resource_group_name=resource_group.name,
restart_policy=containerinstance.ContainerGroupRestartPolicy.NEVER,
restart_policy=containerinstance.ContainerGroupRestartPolicy.ON_FAILURE,
sku=containerinstance.ContainerGroupSku.STANDARD,
volumes=[
containerinstance.VolumeArgs(
Expand Down

0 comments on commit bfd56ee

Please sign in to comment.