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

Fixes to allow Deno check to pass and build to succeed. #2161

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9d18828
add further type checks to catching errors, and then immediately ts-i…
rwblair Oct 14, 2024
cbe29a7
bump github workflows to use deno v2
rwblair Oct 14, 2024
0c4088e
do we really need to specify --node-modules-dir=auto for these deno c…
rwblair Oct 14, 2024
ff37b3a
allow-env during build step.
rwblair Oct 14, 2024
15ebfce
why does installing std library require special permissions?
rwblair Oct 14, 2024
8877ba6
build needs to run git, set --allow-run
rwblair Oct 14, 2024
e6aea46
should of just -A'd it eh?
rwblair Oct 14, 2024
0af7d7e
Update .github/workflows/deno_tests.yml
effigies Oct 15, 2024
a174a76
specify default import from ajv in validators/json.ts imports
rwblair Oct 15, 2024
d941cf6
Merge branch 'fix/deno_2_test_and_build' of github.com:rwblair/bids-v…
rwblair Oct 15, 2024
b67e28f
revert ajv import bump version. Deno may be installing from package.j…
rwblair Oct 15, 2024
dde7007
bump ajv in package.json. Will this break legacy?
rwblair Oct 15, 2024
0b88900
Revert "bump ajv in package.json. Will this break legacy?"
rwblair Oct 15, 2024
fd86b31
move legacy validator to its own directory.
rwblair Oct 15, 2024
3ac00ad
working-dir -> working-directory
rwblair Oct 15, 2024
3331f80
more working-directory setting. fix sym link from legacy test to curr…
rwblair Oct 15, 2024
d3258d2
more working-directory setting. fix sym link from legacy test to curr…
rwblair Oct 15, 2024
c9ed50c
in progress README updates
rwblair Oct 15, 2024
064fea7
Merge branch 'master' of github.com:bids-standard/bids-validator into…
rwblair Oct 17, 2024
c87f70c
set working directory for circleci
rwblair Oct 17, 2024
e9e919c
Merge branch 'fix/deno_2_test_and_build' of github.com:rwblair/bids-v…
rwblair Oct 17, 2024
10044b7
deno loader back to version 11
rwblair Oct 17, 2024
efbbc77
amend circle cache paths, they may not respect working-directory
rwblair Oct 17, 2024
bc6afbb
working-directory -> working_directory
rwblair Oct 17, 2024
8f4fd8f
fix call to get local version
rwblair Oct 17, 2024
25c4bb3
remove circleci config
rwblair Oct 17, 2024
0c3f8a8
first pass at deno dockerfile. Update docker github workflow accordin…
rwblair Oct 21, 2024
5f75b1e
Revert "remove circleci config"
rwblair Oct 21, 2024
6923b6f
Move dockerfile to base. Deno cli now handles git not existing.
rwblair Oct 24, 2024
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
102 changes: 0 additions & 102 deletions .circleci/config.yml

This file was deleted.

62 changes: 6 additions & 56 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build & publish containers

on:
pull_request:
branches: [master]
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
Expand All @@ -9,6 +11,7 @@ jobs:
push_docker_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
working-directory: bids-validator
steps:
- name: Check out the repo
uses: actions/checkout@v4
Expand All @@ -29,61 +32,8 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
push: true
push: false
target: base
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

push_singularity_to_registry:
runs-on: ubuntu-latest
needs:
- push_docker_to_registry
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v5
with:
go-version: 1.13
id: go
- name: Install Dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
build-essential \
libssl-dev \
uuid-dev \
libgpgme11-dev \
squashfs-tools \
libseccomp-dev \
pkg-config
- name: Install Singularity
env:
SINGULARITY_VERSION: 3.8.0
GOPATH: /tmp/go
run: |
mkdir -p $GOPATH
sudo mkdir -p /usr/local/var/singularity/mnt && \
mkdir -p $GOPATH/src/github.com/sylabs && \
cd $GOPATH/src/github.com/sylabs && \
wget -qO- https://github.com/sylabs/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-ce-${SINGULARITY_VERSION}.tar.gz | \
tar xzv && \
cd singularity-ce-${SINGULARITY_VERSION} && \
./mconfig -p /usr/local && \
make -C builddir && \
sudo make -C builddir install
- name: Check out code for the container build
uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: bids/validator
- name: Build Container
run: |
tags=${{ steps.meta.outputs.tags }}
echo $tags
singularity pull container.sif docker://${tags%,*}
- name: Login and Deploy Container
if: (github.event_name != 'pull_request')
run: |
tags=${{ steps.meta.outputs.tags }}
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
for tag in $(echo $tags | sed "s/,/ /g" | sed "s/bids\/validator/bids-standard\/bids-validator/g");
do echo $tag; singularity push container.sif oras://ghcr.io/$tag; done
outputs: type=cacheonly
20 changes: 20 additions & 0 deletions bids-validator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG BASE_IMAGE=denoland/deno:2.0.1
FROM ${BASE_IMAGE} AS base
WORKDIR /src

RUN apt-get update && \
apt-get install -y git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY . .
RUN deno cache ./bids-validator-deno
RUN ./build.ts

ENTRYPOINT ["./bids-validator-deno"]

FROM ${BASE_IMAGE} AS min
WORKDIR /src
COPY --from=base /src/dist/validator/* .

ENTRYPOINT ["deno", "-A", "./bids-validator.js"]
2 changes: 1 addition & 1 deletion bids-validator/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function getVersion(): Promise<string> {
async function getLocalVersion(path: string): Promise<string> {
// safe.directory setting so we could still operate from another user
const command = new Deno.Command("git", {
args: ['git', '-C', path, '-c', 'safe.directory=*', 'describe', '--tags', '--always'],
args: ['-C', path, '-c', 'safe.directory=*', 'describe', '--tags', '--always'],
})
rwblair marked this conversation as resolved.
Show resolved Hide resolved
const { success, stdout } = await command.output();
const description = new TextDecoder().decode(stdout).trim()
Expand Down