Skip to content

Commit

Permalink
Merge pull request #289 from askomics/fix_npm
Browse files Browse the repository at this point in the history
Fix npm install on quay.io
  • Loading branch information
abretaud authored Oct 15, 2021
2 parents 137b444 + 212dff3 commit 2a8f557
Show file tree
Hide file tree
Showing 9 changed files with 470 additions and 460 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.8
- name: Install flake8
run: pip install flake8
- name: Flake8
Expand All @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.6
python-version: 3.8
- name: Update apt cache
run: sudo apt-get update
- name: Install python-ldap deps
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ test-js: eslint

eslint: check-node-modules
@echo -n 'Linting javascript... '
$(NODEDIR)/.bin/eslint --config $(BASEDIR)/.eslintrc.yml "$(BASEDIR)/askomics/react/src/**"
$(NODEDIR)/.bin/eslint --config $(BASEDIR)/.eslintrc.yml "$(BASEDIR)/askomics/react/src/**" || { echo "ERROR"; exit 1; }
@echo "Done"

test-python: pylint pytest
Expand All @@ -94,7 +94,7 @@ pytest: check-venv
pylint: check-venv
@echo -n 'Linting python... '
. $(ACTIVATE)
flake8 $(BASEDIR)/askomics $(BASEDIR)/tests --ignore=E501,W504
flake8 $(BASEDIR)/askomics $(BASEDIR)/tests --ignore=E501,W504 || { echo "ERROR"; exit 1; }
@echo "Done"

serve: check-venv build-config create-user
Expand Down Expand Up @@ -126,32 +126,32 @@ check-node-modules:

build-config:
@echo -n 'Building config file... '
bash cli/set_config.sh
bash cli/set_config.sh || { echo "ERROR"; exit 1; }
@echo 'Done'

create-user:
@echo -n 'Creating first user... '
. $(ACTIVATE)
bash cli/set_user.sh
bash cli/set_user.sh || { echo "ERROR"; exit 1; }
@echo 'Done'

update-base-url: check-venv
@echo 'Updating base url...'
. $(ACTIVATE)
bash cli/update_base_url.sh
bash cli/update_base_url.sh || { echo "ERROR"; exit 1; }
@echo 'Done'

clear-cache: check-venv
@echo 'Clearing abstraction cache...'
. $(ACTIVATE)
bash cli/clear_cache.sh
bash cli/clear_cache.sh || { echo "ERROR"; exit 1; }
@echo 'Done'

build: build-js

build-js: check-node-modules
@echo 'Building askomics.js... '
$(NPM) run --silent $(NPMOPTS)
$(NPM) run --silent $(NPMOPTS) || { echo "ERROR"; exit 1; }
@echo ' Done'

install: install-python install-js
Expand All @@ -161,22 +161,22 @@ fast-install:

install-python: check-python
@echo -n 'Building python virtual environment... '
$(PYTHON) -m venv $(VENVDIR)
$(PYTHON) -m venv $(VENVDIR) || { echo "ERROR"; exit 1; }
@echo 'Done'
@echo -n 'Sourcing Python virtual environment... '
. $(ACTIVATE)
. $(ACTIVATE) || { echo "ERROR"; exit 1; }
@echo 'Done'
@echo -n 'Upgrading pip... '
$(PIP) install --upgrade pip > /dev/null
$(PIP) install --upgrade pip > /dev/null || { echo "ERROR"; exit 1; }
@echo 'Done'
@echo 'Installing Python dependencies inside virtual environment... '
$(PIP) install -e . > /dev/null
PIPENV_VERBOSITY=-1 $(PIPENV) install $(PIPENVOPTS)
$(PIP) install -e . > /dev/null || { echo "ERROR"; exit 1; }
PIPENV_VERBOSITY=-1 $(PIPENV) install $(PIPENVOPTS) || { echo "ERROR"; exit 1; }
@echo ' Done'

install-js: check-npm
@echo 'Installing javascript dependencies inside node_modules... '
$(NPM) install --silent
$(NPM) install || { echo "ERROR"; exit 1; }
@echo ' Done'

clean: clean-js clean-python
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "pypi"

[packages]
werkzeug = "==0.16.1"
flask = "==1.1.4"
flask = "<2"
flask-reverse-proxy-fix = "*"
validate-email = "*"
gunicorn = "*"
Expand Down
879 changes: 445 additions & 434 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion askomics/libaskomics/SparqlQueryLauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def insert_data(self, ttl, graph, metadata=False):
TYPE
query result
"""
triples = self.get_triples_from_graph(ttl) if metadata else ttl.serialize(format='nt').decode("utf-8")
triples = self.get_triples_from_graph(ttl) if metadata else ttl.serialize(format='nt')

query = '''
INSERT {{
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM askomics/flaskomics-base:4.0.0-alpine3.9 AS builder
FROM quay.io/askomics/flaskomics-base:4.0.0-alpine3.14 AS builder
MAINTAINER "Xavier Garnier <xavier.garnier@irisa.fr>"

COPY . /askomics
Expand All @@ -7,10 +7,10 @@ WORKDIR /askomics
RUN make clean-config fast-install build

# Final image
FROM alpine:3.9
FROM alpine:3.14

WORKDIR /askomics
RUN apk add --no-cache make python3 bash git libc-dev libstdc++ nodejs nodejs-npm openldap-dev
RUN apk add --no-cache make python3 bash git libc-dev libstdc++ nodejs-current npm openldap-dev
COPY --from=builder /askomics .

EXPOSE 5000
Expand Down
6 changes: 3 additions & 3 deletions docker/DockerfileAll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build AskOmics
FROM askomics/flaskomics-base:4.0.0-alpine3.9 AS askomics_builder
FROM quay.io/askomics/flaskomics-base:4.0.0-alpine3.14 AS askomics_builder
MAINTAINER "Xavier Garnier <xavier.garnier@irisa.fr>"

COPY . /askomics
Expand All @@ -14,7 +14,7 @@ FROM xgaia/corese:20.6.11 AS corese_builder
FROM askomics/virtuoso:7.2.5.1 AS virtuoso_builder

# Final image
FROM alpine:3.8
FROM alpine:3.14

ENV MODE="prod" \
NTASKS="5" \
Expand All @@ -35,7 +35,7 @@ RUN apk add --no-cache openssl py-pip && \
apk --no-cache add --update openjdk11 --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community && \
mkdir /corese && \
apk add --no-cache redis sqlite && \
apk add --no-cache make python3 bash git libc-dev libstdc++ nodejs nodejs-npm openldap-dev
apk add --no-cache make python3 bash git libc-dev libstdc++ nodejs-current nodejs openldap-dev

COPY --from=virtuoso_builder /usr/local/virtuoso-opensource /usr/local/virtuoso-opensource
COPY --from=virtuoso_builder /virtuoso /virtuoso
Expand Down
4 changes: 2 additions & 2 deletions docker/DockerfileCelery
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM askomics/flaskomics-base:4.0.0-alpine3.9 AS builder
FROM quay.io/askomics/flaskomics-base:4.0.0-alpine3.14 AS builder
MAINTAINER "Xavier Garnier <xavier.garnier@irisa.fr>"

COPY . /askomics
Expand All @@ -7,7 +7,7 @@ WORKDIR /askomics
RUN make clean-config fast-install

# Final image
FROM alpine:3.9
FROM alpine:3.14

WORKDIR /askomics
RUN apk add --no-cache make python3 bash git libc-dev libstdc++ openldap-dev
Expand Down
1 change: 0 additions & 1 deletion tests/test_api_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,5 +600,4 @@ def test_serve_file(self, client):
response = client.client.get('/api/files/ttl/1/jdoe/{}'.format(filename))

assert response.status_code == 200
# print(response.data.decode("utf-8"))
assert response.data.decode("utf-8") == content

0 comments on commit 2a8f557

Please sign in to comment.