Skip to content

Commit 959793c

Browse files
authored
Merge pull request #172 from morph-data/fix/initial-morph-project-yml
fix initial morph_project.yml
2 parents a8e639b + 54bdda5 commit 959793c

1 file changed

Lines changed: 9 additions & 15 deletions

File tree

core/morph/config/project.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def dump_project_yaml(project: MorphProject) -> str:
105105
build_runtime = ""
106106
build_framework = ""
107107
build_package_manager = ""
108-
build_context = "# context: ."
108+
build_context = "."
109109
build_args_str = "\n # - ARG_NAME=value\n # - ANOTHER_ARG=value"
110110
deployment_provider = "aws"
111111
deployment_aws_region = "us-east-1"
@@ -121,32 +121,26 @@ def dump_project_yaml(project: MorphProject) -> str:
121121
# Set values if build exists
122122
if project.build:
123123
if project.build.use_custom_dockerfile is not None:
124-
build_use_custom_dockerfile = str(project.build.use_custom_dockerfile)
124+
build_use_custom_dockerfile = str(
125+
project.build.use_custom_dockerfile
126+
).lower()
125127
if project.build.runtime:
126128
build_runtime = project.build.runtime or ""
127129
if project.build.framework:
128130
build_framework = project.build.framework or ""
129131
if project.build.package_manager:
130132
build_package_manager = project.build.package_manager or ""
131133
if project.build.context:
132-
build_context = project.build.context or "# context: ."
134+
build_context = f"{project.build.context}" or "."
133135
if project.build.build_args:
134136
build_args_items = []
135137
for key, value in project.build.build_args.items():
136138
build_args_items.append(f"{key}={value}")
137139
build_args_str = (
138-
"\n - ".join([""] + build_args_items)
140+
"\n # - ".join([""] + build_args_items)
139141
if build_args_items
140142
else "\n # - ARG_NAME=value\n # - ANOTHER_ARG=value"
141143
)
142-
else:
143-
# Use default BuildConfig
144-
build_use_custom_dockerfile = "false"
145-
build_runtime = ""
146-
build_framework = ""
147-
build_package_manager = ""
148-
build_context = "# context: ."
149-
build_args_str = "\n # - ARG_NAME=value\n # - ANOTHER_ARG=value"
150144

151145
# Set values if deployment exists
152146
if project.deployment:
@@ -176,7 +170,7 @@ def dump_project_yaml(project: MorphProject) -> str:
176170
return f"""
177171
# Cloud Settings
178172
profile: {project.profile} # Defined in the Profile Section in `~/.morph/credentials`
179-
project_id: {project.project_id}
173+
project_id: {project.project_id or ""}
180174
181175
# Framework Settings
182176
default_connection: {project.default_connection}
@@ -192,8 +186,8 @@ def dump_project_yaml(project: MorphProject) -> str:
192186
package_manager: {build_package_manager} # pip, poetry, uv
193187
# These settings are required when use_custom_dockerfile is true
194188
# They define how the Docker image will be built
195-
context: {build_context if build_context != "# context: ." else "# context: ."}
196-
build_args:{build_args_str}
189+
# context: {build_context}
190+
# build_args:{build_args_str}
197191
198192
# Deployment Settings
199193
deployment:

0 commit comments

Comments
 (0)