Skip to content

Commit e4a1b78

Browse files
authored
Merge pull request #104 from cloudblue/add_node_to_image
Add node to image
2 parents b5a30bb + dd91ffd commit e4a1b78

File tree

6 files changed

+114
-77
lines changed

6 files changed

+114
-77
lines changed

Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
FROM python:3.8
1+
FROM python:3.10
2+
3+
ENV NODE_VERSION=16.17.1
4+
5+
RUN apt install -y curl
6+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
7+
ENV NVM_DIR=/root/.nvm
8+
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
9+
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
10+
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
11+
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
12+
RUN node --version
13+
RUN npm --version
214

315
ARG RUNNER_VERSION
416

connect/eaas/runner/workers/web.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,18 @@ async def process_task(self, task):
9999
)
100100
await self.send(message)
101101

102+
def get_logging_level(self):
103+
if self.config.logging_level:
104+
return self.config.logging_level
105+
current_level = logging.getLogger('eaas').getEffectiveLevel()
106+
return logging.getLevelName(current_level)
107+
102108
def get_internal_headers(self, task):
103109
headers = {}
104110
headers['X-Connect-Api-Gateway-Url'] = self.config.get_api_url()
105111
headers['X-Connect-User-Agent'] = self.config.get_user_agent()['User-Agent']
106112
headers['X-Connect-Extension-Id'] = self.config.service_id
107-
headers['X-Connect-Logging-Level'] = self.config.logging_level or 'DEBUG'
113+
headers['X-Connect-Logging-Level'] = self.get_logging_level()
108114
headers['X-Connect-Config'] = json.dumps(self.config.variables)
109115

110116
if task.options.api_key:

entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ if [[ "$@" == *"cextrun"* ]]; then
3535

3636
if [ -d "$DIST_DIR" ]; then rm -Rf $DIST_DIR; fi
3737

38+
if [ -f "package.json" ]; then
39+
npm run build
40+
fi
41+
3842
poetry build
3943

4044
pip install -U pip && pip install -U --force-reinstall $DIST_DIR/*.whl

0 commit comments

Comments
 (0)