I
Immich•3y ago
EnochPrime

Development Setup

I was looking to help out more with this project, but I am having some issues. I have a Linux system with VSCode and found I needed to install npm and now I'm stuck with jest issues. What are the appropriate steps to set up?
35 Replies
jrasm91
jrasm91•3y ago
Actually, the easiest way to get up and running is to use docker. If you do a make dev in the root directory, it'll run a docker compose command which will start the api/microservices/web/proxy with npm/node already installed in the container running in dev mode (hot reload, etc.)
EnochPrime
EnochPrimeOP•3y ago
Interesting I'll give that a go.
Alex Tran
Alex Tran•3y ago
1. Go into server run npm i 2. Go into web run npm i 3. Populate .env file for development environment in docker folder 4. From the root directory run make dev
jrasm91
jrasm91•3y ago
Why do you need to run npm i? That's a part of the docker file.
jrasm91
jrasm91•3y ago
We have some of this information here btw: https://immich.app/docs/developer/setup
Setup | Immich
Environment
Alex Tran
Alex Tran•3y ago
for local intellisense
jrasm91
jrasm91•3y ago
../server:/usr/src/app
Alex Tran
Alex Tran•3y ago
I haven't really tried just to run make dev without installing the local node_modules interesting well that simplify it
jrasm91
jrasm91•3y ago
There's already a volume mount for the whole server directory
Alex Tran
Alex Tran•3y ago
OK, thanks that is great, learn something new everyday hehe
jrasm91
jrasm91•3y ago
Lol, aren't you the one that set this up? 😛
Alex Tran
Alex Tran•3y ago
I've always had to run npm i lemme test it real quick interestig in the result
jrasm91
jrasm91•3y ago
There is another anon volume for node_modules specifically, maybe that doesn't sync the two
Alex Tran
Alex Tran•3y ago
Hmm vscode doesn't have intellisense if you don't install it locally
Alex Tran
Alex Tran•3y ago
No description
Alex Tran
Alex Tran•3y ago
And node_modules is mounted as root
No description
Alex Tran
Alex Tran•3y ago
so yeah, install npm i first then perform make dev is how it works on my enviroment you don't have to do that?
Alex Tran
Alex Tran•3y ago
Anyway @EnochPrime Good info to start from here https://immich.app/docs/developer/architecture
Architecture | Immich
High Level Diagram
jrasm91
jrasm91•3y ago
I think I have done npm i, but I'm already setup to do development in node on my machine so I ran it there before I started doing the docker thing. It seems like it defeats the point a bit using docker AND having to install the deps locally.
Alex Tran
Alex Tran•3y ago
When you are on your machine, can you try to run make dev without node_modules install in the server to see if this only apply to my development environment?
EnochPrime
EnochPrimeOP•3y ago
$ make dev
rm -rf ./server/dist && docker-compose -f ./docker/docker-compose.dev.yml up --remove-orphans
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.25.8) or chardet (4.0.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string.
WARNING: The IMMICH_SERVER_URL variable is not set. Defaulting to a blank string.
WARNING: The IMMICH_API_URL_EXTERNAL variable is not set. Defaulting to a blank string.
WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string.
WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank
string.
ERROR: Version in "././docker/docker-compose.dev.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
make: *** [Makefile:2: dev] Error 1
$ make dev
rm -rf ./server/dist && docker-compose -f ./docker/docker-compose.dev.yml up --remove-orphans
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.25.8) or chardet (4.0.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string.
WARNING: The IMMICH_SERVER_URL variable is not set. Defaulting to a blank string.
WARNING: The IMMICH_API_URL_EXTERNAL variable is not set. Defaulting to a blank string.
WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string.
WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank
string.
ERROR: Version in "././docker/docker-compose.dev.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
make: *** [Makefile:2: dev] Error 1
jrasm91
jrasm91•3y ago
You will need to create a .env in the docker folder, similar to how you would in a normal installation.
EnochPrime
EnochPrimeOP•3y ago
I did
jrasm91
jrasm91•3y ago
What version of compose do you have installed? docker-compose --version
EnochPrime
EnochPrimeOP•3y ago
Apparently something not functional...
$ docker-compose --version
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.25.8) or chardet (4.0.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "docker-compose version 1.25.0, build unknown
$ docker-compose --version
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.25.8) or chardet (4.0.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "docker-compose version 1.25.0, build unknown
jrasm91
jrasm91•3y ago
On the docker website they talk about removing the provided packages and then re-installing from a specific repo. Maybe this is what those instructions are for.
EnochPrime
EnochPrimeOP•3y ago
I'll have to look into that, thanks. I deploy with docker swarm which supports (most of) compose. Didn't know it was broken.
jrasm91
jrasm91•3y ago
Is docker compose version any different? You could try make dev-new
EnochPrime
EnochPrimeOP•3y ago
My understanding is swarm implements the specification directly rather than using the python package. Although I've never dug into those details.
jrasm91
jrasm91•3y ago
It looks like there used to be a separate project docker-compose, which was implemented in python. The new version (v2) was rewritten in go and is available as a subcommand and provided as part of the docker executable. So docker compose
EnochPrime
EnochPrimeOP•3y ago
Ah so maybe I just need to remove the python package.
jrasm91
jrasm91•3y ago
It sounds like they pretty much do the same thing, but you call one with a space and one with a dash. You might have the space one working on your system and it looks like make dev-new uses the space version.
EnochPrime
EnochPrimeOP•3y ago
Not sure if it is valid at this point, but...
$ make dev-new
rm -rf ./server/dist && docker compose -f ./docker/docker-compose.dev.yml up --remove-orphans
unknown shorthand flag: 'f' in -f
See 'docker --help'.
$ make dev-new
rm -rf ./server/dist && docker compose -f ./docker/docker-compose.dev.yml up --remove-orphans
unknown shorthand flag: 'f' in -f
See 'docker --help'.
jrasm91
jrasm91•3y ago
This is what's installed on my system FWIW
No description
EnochPrime
EnochPrimeOP•3y ago
Installed docker-compose-plugin and make dev-new appears to be working.

Did you find this page helpful?