Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Frontend dependencies #1874

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions hack/Dockerfile
Original file line number Diff line number Diff line change
@@ -51,25 +51,18 @@ RUN set -ex \
&& add-apt-repository --no-update --yes "deb http://archive.ubuntu.com/ubuntu/ jammy multiverse" \
&& add-apt-repository --no-update --yes "deb http://archive.ubuntu.com/ubuntu/ jammy-security universe" \
&& add-apt-repository --no-update --yes "deb http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse" \
&& curl -sS https://deb.nodesource.com/setup_14.x | bash - \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use 18.x or 20.x? Related: https://endoflife.date/nodejs.

&& curl -so /tmp/repo-mediaarea_1.0-21_all.deb -L https://mediaarea.net/repo/deb/repo-mediaarea_1.0-21_all.deb \
&& dpkg -i /tmp/repo-mediaarea_1.0-21_all.deb \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
libyaml-dev clamav \
libyaml-dev clamav nodejs \
&& /src/hack/osdeps.py Ubuntu-22 1 | grep -v -E "nginx|postfix|python3.9-dev" | xargs apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Download ClamAV virus signatures
RUN freshclam --quiet

# Install pip, Node.js and Yarn
RUN set -ex \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& add-apt-repository --yes "deb https://dl.yarnpkg.com/debian/ stable main" \
&& apt-get install -y --no-install-recommends \
yarn nodejs \
&& rm -rf /var/lib/apt/lists/*

ENV PYENV_ROOT="/pyenv/data"
ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH

@@ -143,10 +136,15 @@ RUN set -ex \
&& mkdir -p $internalDirs \
&& chown -R archivematica $internalDirs

RUN set ex \
&& npm install -g npm@9.8.1
Comment on lines +139 to +140
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 9.8.1 and not the latest 9.x, e.g. 9.9.2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you and noted all your suggestions. I made changes accordingly in #1875


USER archivematica

RUN set -ex \
&& yarn --cwd=/src/src/dashboard/frontend install --frozen-lockfile
Dhwaniartefact marked this conversation as resolved.
Show resolved Hide resolved
WORKDIR /src/src/dashboard/frontend

RUN set ex \
&& npm install --no-package-lock

WORKDIR /src/src/dashboard/src

@@ -197,7 +195,7 @@ USER archivematica

WORKDIR /src/src/dashboard/frontend

ENTRYPOINT ["yarn", "run", "test-single-run"]
ENTRYPOINT ["npm", "run", "test-single-run"]

# -----------------------------------------------------------------------------

13 changes: 7 additions & 6 deletions hack/Makefile
Original file line number Diff line number Diff line change
@@ -168,13 +168,14 @@ bootstrap-dashboard-db: ## Bootstrap Dashboard (new database).

bootstrap-dashboard-frontend: ## Build front-end assets.
docker compose run \
-e HOME=/tmp/yarn-config \
--workdir /src/src/dashboard/frontend \
-e HOME=/tmp/npm-config \
--rm \
--no-deps \
--user $(CALLER_UID):$(CALLER_GID) \
--entrypoint yarn \
--entrypoint npm \
archivematica-dashboard \
--cwd=/src/src/dashboard/frontend install --frozen-lockfile
install --no-package-lock

restart-am-services: ## Restart Archivematica services: MCPServer, MCPClient, Dashboard and Storage Service.
docker compose restart --no-deps archivematica-mcp-server
@@ -385,13 +386,13 @@ test-frontend: ## Run Dashboard JS tests.
--build-arg TARGET=archivematica-dashboard-testing \
../
docker run \
-e HOME=/tmp/yarn-config \
-e HOME=/tmp/npm-config \
--rm \
--user $(CALLER_UID):$(CALLER_GID) \
--volume "$(SRCDIR)/dashboard:/src/src/dashboard" \
--entrypoint yarn \
--entrypoint npm \
archivematica-dashboard-testing \
--cwd=/src/src/dashboard/frontend install --frozen-lockfile
install
docker run \
--rm \
--volume "$(SRCDIR)/dashboard/frontend:/src/src/dashboard/frontend" \
Loading