buildingSMART / buildingSMART/validate

[Documentation] - Installating the Validation Service on Windows

Open
#279 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
67
Forks
20
Avg merge
1d 14h
Merged PRs (30d)
13

Description

Hello,

I have installed the validation service on **Windows** and wanted to share the hardships I encountered as I was little familiar with Git and even less with Docker.

So this post is less an issue itself and more of additional documentation.

## Clone the repository
Using _git clone _ is the proper first step but might not be enough.

### Install the main repository
1. Clone the repository | git clone
2. Check that the repository is up-to-date with the main branch | git status
3. In case it isn't, retrieve the main branch content | git pull
4. Assess that the branch is up-to-date | git status

### Update submodules

A submodule is a git repository that is referenced by a parent git repository.
The validation service is currently composed of three submodules :

- ifc_gherkin_rules
- store
- ifc_validation_models

Submodules can be identified :

- In CLI, using the command _git submodule status_
- In navigator, by the arrow inside its folder icon and its last commit identifier (starting with the character @).

To update submodules, use the command **git submodule update --init --recursive**.

Check the submodules status again. Since some submodules possess a specific revision, their current branch might be detached from the main branch. If detached, **not all required code and resources might be available.**

**For each submodule that has a different revision:**
1. Go to its repository | cd
2. Retrieve all branches | git fetch
3. Change to main branch | git checkout main
4. Retrieve main branch content | git pull
5. Assess the new status | git status

After retrieving the main branch content and for the purpose of simply setting the validation service, it does not matter that some changes are not staged for commit. **The only requirement is for the local branch to be up to date with origin/main.**

## Sanitize Scripts

### End of line
Line endings in text files are expressed using:
- **CRLF**, stands for Carriage Return \r + Line Feed \n and is the standard for line breaks on Windows.
- **LF** ,stands for Line Feed \n and is the standard in the Linux and Unix world.

Docker containers run Linux under the hood that doens't handle CRLF well, especially with scripts and configuration files.

As such, the typical failure symptoms include :

- Shell scripts throwing error messages when executed.
- bash reporting Command not found even though the command is well written.

During the container build, the process may even fail quietly.

### ADD --chmod
ADD --chmod can also fail quietly for various reasons.

---

To solve these problems I have replaced

in \docker\backend\Dockerfile :
```
ADD --chmod=777 ./docker/backend/server-entrypoint.sh /app/backend
ADD --chmod=777 ./docker/backend/worker-entrypoint.sh /app/backend
```
by

```
COPY ./docker/backend/server-entrypoint.sh /app/backend/
COPY ./docker/backend/worker-entrypoint.sh /app/backend/

RUN sed -i 's/\r$//' /app/backend/*entrypoint.sh && \
chmod +x /app/backend/*entrypoint.sh
```

In docker\frontend\Dockerfile:
```
# copy custom boot scripts
ADD --chmod=777 ./docker/frontend/docker-entrypoint.d/ /docker-entrypoint.d/
```
by

```
# copy custom boot scripts
COPY /docker/frontend/docker-entrypoint.d/ /docker-entrypoint.d/

RUN sed -i 's/\r$//' /docker-entrypoint.d/*.sh && \
chmod +x /docker-entrypoint.d/*.sh
```

## Sanitize Production

At the moment I installed the validation service, there was a remaining file merge that was blocking the process.
I had to **remove** \backend\apps\ifc_validation_models\migrations\0018_merge_20251008_1414.py.

---

Feel free to add more insight or to correct the mistakes I may have written.

Best Regards,
Guillaume

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.