|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
| 15 | + |
15 | 16 | import click |
16 | 17 |
|
17 | 18 | TEMP_PATH = "/tmp" |
|
29 | 30 | help="Volcengine secret key", |
30 | 31 | ) |
31 | 32 | @click.option("--vefaas-app-name", help="Expected Volcengine FaaS application name") |
32 | | -@click.option("--veapig-instance-name", help="Expected Volcengine APIG instance name") |
33 | | -@click.option("--veapig-service-name", help="Expected Volcengine APIG service name") |
34 | | -@click.option("--veapig-upstream-name", help="Expected Volcengine APIG upstream name") |
| 33 | +@click.option( |
| 34 | + "--veapig-instance-name", default="", help="Expected Volcengine APIG instance name" |
| 35 | +) |
| 36 | +@click.option( |
| 37 | + "--veapig-service-name", default="", help="Expected Volcengine APIG service name" |
| 38 | +) |
| 39 | +@click.option( |
| 40 | + "--veapig-upstream-name", default="", help="Expected Volcengine APIG upstream name" |
| 41 | +) |
35 | 42 | @click.option( |
36 | 43 | "--short-term-memory-backend", |
37 | 44 | default="local", |
@@ -110,6 +117,17 @@ def deploy( |
110 | 117 | shutil.copytree(user_proj_abs_path, agent_dir, dirs_exist_ok=True) |
111 | 118 | logger.debug(f"Remove agent module from {user_proj_abs_path} to {agent_dir}") |
112 | 119 |
|
| 120 | + # copy requirements.txt |
| 121 | + if (user_proj_abs_path / "requirements.txt").exists(): |
| 122 | + shutil.copy( |
| 123 | + user_proj_abs_path / "requirements.txt", |
| 124 | + Path(TEMP_PATH) / tmp_dir_name / "src" / "requirements.txt", |
| 125 | + ) |
| 126 | + else: |
| 127 | + logger.warning( |
| 128 | + "No requirements.txt found in the user project, we will use a default one." |
| 129 | + ) |
| 130 | + |
113 | 131 | # load |
114 | 132 | logger.debug( |
115 | 133 | f"Load deploy module from {Path(TEMP_PATH) / tmp_dir_name / 'deploy.py'}" |
|
0 commit comments