Skip to content

Commit

Permalink
0.7.0: Making REPO_PATH only mandatory on directory mode
Browse files Browse the repository at this point in the history
  • Loading branch information
flavienbwk committed Sep 8, 2024
1 parent 6da3373 commit df7e2c5
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 17 deletions.
10 changes: 0 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,9 @@ RUN echo "events { worker_connections 1024; }" > /etc/nginx/nginx.conf && \
echo " server_name _;" >> /etc/nginx/nginx.conf && \
echo " location / {" >> /etc/nginx/nginx.conf && \
echo " proxy_pass http://127.0.0.1:3000;" >> /etc/nginx/nginx.conf && \
echo " proxy_http_version 1.1;" >> /etc/nginx/nginx.conf && \
echo " proxy_set_header Upgrade \$http_upgrade;" >> /etc/nginx/nginx.conf && \
echo " proxy_set_header Connection 'upgrade';" >> /etc/nginx/nginx.conf && \
echo " proxy_set_header Host \$host;" >> /etc/nginx/nginx.conf && \
echo " proxy_cache_bypass \$http_upgrade;" >> /etc/nginx/nginx.conf && \
echo " }" >> /etc/nginx/nginx.conf && \
echo " location /api {" >> /etc/nginx/nginx.conf && \
echo " proxy_pass http://127.0.0.1:5328;" >> /etc/nginx/nginx.conf && \
echo " proxy_http_version 1.1;" >> /etc/nginx/nginx.conf && \
echo " proxy_set_header Upgrade \$http_upgrade;" >> /etc/nginx/nginx.conf && \
echo " proxy_set_header Connection 'upgrade';" >> /etc/nginx/nginx.conf && \
echo " proxy_set_header Host \$host;" >> /etc/nginx/nginx.conf && \
echo " proxy_cache_bypass \$http_upgrade;" >> /etc/nginx/nginx.conf && \
echo " }" >> /etc/nginx/nginx.conf && \
echo " }" >> /etc/nginx/nginx.conf && \
echo "}" >> /etc/nginx/nginx.conf
Expand Down
5 changes: 3 additions & 2 deletions action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ try {
console.log('Retrieved existing namespace:', namespace.id);
} else {
console.error('Error creating/retrieving namespace:', error);
throw error;
core.setFailed(error.message);
}
}

Expand Down Expand Up @@ -130,7 +130,7 @@ try {
});
console.log('Container updated:', container.id);
} else {
throw error;
core.setFailed(error.message);
}
}

Expand Down Expand Up @@ -173,6 +173,7 @@ try {
}

// Feed RepoChat with repo data
// TODO(flavienbwk): !!

// Set outputs
core.setOutput('domain', containerEndpoint);
Expand Down
1 change: 0 additions & 1 deletion api.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ services:
environment:
REPO_NAME: ${REPO_NAME}
REPO_URL: ${REPO_URL}
REPO_PATH: ${REPO_PATH}
OPENAI_API_KEY: ${OPENAI_API_KEY}
MODEL_TYPE_INFERENCE: ${MODEL_TYPE_INFERENCE}
MODEL_TYPE_EMBEDDING: ${MODEL_TYPE_EMBEDDING}
Expand Down
2 changes: 1 addition & 1 deletion api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

REPO_NAME = os.environ['REPO_NAME'].strip()
REPO_URL = os.getenv('REPO_URL', '').strip()
REPO_PATH = os.environ['REPO_PATH'].strip()
REPO_PATH = os.getenv('REPO_PATH', '').strip()
OPEN_AI_API_KEY = os.environ['OPENAI_API_KEY'].strip()
MODEL_TYPE_INFERENCE = os.environ['MODEL_TYPE_INFERENCE'].strip()
MODEL_TYPE_EMBEDDING = os.environ['MODEL_TYPE_EMBEDDING'].strip()
Expand Down
2 changes: 2 additions & 0 deletions api/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def get_model():
logging.info(f"DB directory {PERSIST_DIRECTORY} does not exist. No need to clear.")

if MODE == "directory":
if REPO_PATH == "":
raise Exception("Repo path is required for directory mode")
return DirLoader(
repo_path=REPO_PATH,
force_reingest=CLEAR_DB_AT_RESTART,
Expand Down
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70229,7 +70229,7 @@ try {
console.log('Retrieved existing namespace:', namespace.id);
} else {
console.error('Error creating/retrieving namespace:', error);
throw error;
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(error.message);
}
}

Expand Down Expand Up @@ -70273,7 +70273,7 @@ try {
});
console.log('Container updated:', container.id);
} else {
throw error;
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(error.message);
}
}

Expand Down Expand Up @@ -70316,6 +70316,7 @@ try {
}

// Feed RepoChat with repo data
// TODO(flavienbwk): !!

// Set outputs
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput('domain', containerEndpoint);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gh-action-repochat",
"version": "0.6.0",
"version": "0.7.0",
"type": "module",
"description": "GitHub Action to run repochat",
"main": "index.js",
Expand Down

0 comments on commit df7e2c5

Please sign in to comment.