ubiquity / ubiquity-dollar

Ubiquity Dollar (UUSD) smart contracts and user interface.
https://uad.ubq.fi
Apache License 2.0
34 stars 90 forks source link

Integrate Docker to improve Dev-Xperience #706

Closed molecula451 closed 1 year ago

molecula451 commented 1 year ago

Why Implement Docker to Enhance the Development Experience in Your Repository

Docker has become increasingly popular in the world of software development due to its ability to simplify the deployment and management of applications. Integrating Docker into your repository can significantly enhance the development experience for your team. Here are several compelling reasons why you should consider implementing Docker:

1. Consistent Development Environment

One of the challenges developers often face is setting up and configuring the development environment. With Docker, you can define the entire environment in a Dockerfile, ensuring that all team members have a consistent setup. This eliminates the common "works on my machine" problem and reduces the time spent troubleshooting environment-specific issues.

2. Reproducible Builds

Docker provides reproducibility for software builds. By encapsulating the dependencies and configuration within a container, you can ensure that the build process is consistent across different machines. This allows for easy sharing of the build artifacts and simplifies collaboration within the team.

3. Isolation and Dependency Management

Docker containers create isolated environments, allowing applications to run independently without interfering with the underlying host system. This isolation enables efficient management of dependencies, as you can package all the required libraries, frameworks, and tools within the container. Developers can work on multiple projects with different dependencies simultaneously, avoiding conflicts and versioning issues.

4. Scalability and Flexibility

Docker enables horizontal scalability by leveraging container orchestration tools like Kubernetes. With Docker, you can easily scale your applications up or down to meet varying workload demands. This flexibility is particularly beneficial for projects that require rapid scaling or handle significant traffic fluctuations.

5. Streamlined Onboarding and Continuous Integration

When new developers join the team, Docker simplifies the onboarding process. They can quickly spin up the development environment by running a single command to pull and run the Docker image. Additionally, integrating Docker into your continuous integration (CI) pipeline allows for seamless testing and deployment, ensuring consistent and reliable software delivery.

6. Portability and Compatibility

Docker containers are highly portable, meaning they can run on any platform that supports Docker. This portability eliminates the need to worry about differences in underlying operating systems or system configurations. Developers can easily switch between different environments, such as local development machines, staging servers, and production environments, without modifications.

7. Version Control of Infrastructure

By using Dockerfiles and Docker Compose files, you can version control the infrastructure and configurations required to run your application. This allows you to track changes, roll back to previous versions, and collaborate more effectively within your development team.

Implementing Docker in your repository offers numerous benefits that enhance the development experience. It provides consistency, reproducibility, isolation, scalability, and flexibility, streamlines onboarding and CI processes, ensures portability, and allows version control of the infrastructure. By embracing Docker, you empower your team to focus more on developing features and less on environment-related issues, leading to increased productivity and smoother collaboration.

e.g enviroment issues:

https://github.com/ubiquity/ubiquity-dollar/pull/702#discussion_r1241061400

rndquu commented 1 year ago

I don't see what particular issue the docker solves for the https://github.com/ubiquity/ubiquity-dollar repo

Frontend can be started in a single command yarn start

Contracts are perfectly handled by foundry

Docker is good for really complex setups but we don't have those setups in this repo

Regarding the SMT issue. While it seems to be appropriate to pack installing Z3 and running SMT in a docker container I don't see the reasons to do so because:

  1. Installing and building Z3 is a one liner and creating a separate shell script for it seems to be redundant
  2. I hardly imagine who is gonna run this Z3 shell install script because it is easier to follow the official docs
molecula451 commented 1 year ago

Do not get limited only by the Z3. I raised this issue because how @zgorizzo69 asking me to developed for other platforms https://github.com/ubiquity/ubiquity-dollar/pull/702#discussion_r1241061400 that are probably out of reach within a scope of a PR validates my point. other os

Docker improves this by relying on one platform and one way of doing things. But this is just a suggestion issue, it can be tackle later or might never be

to answer the second. The script it's necessary, the Z3 building it's not about the solidity, the z3 just builds z3 they don't care how you use it. The script outlines a series of steps specifically to run Z3 within! the solidity compiler

https://github.com/ubiquity/ubiquity-dollar/pull/702#discussion_r1241287285

0x4007 commented 1 year ago

Seems that @zgorizzo69 seeks to remove Docker as a dependency and run things natively on the OS by checking if the required dependencies exist?

I like the lightweight (Docker-less) approach just as long as the checks for all the dependencies aren’t too complicated to do. It’s not clear to me how many total dependencies there are in order to complete the script. Ultimately my vote will be based on how many accommodations are required to make it run without Docker. Hopefully it is not too many.

rndquu commented 1 year ago

Do not get limited only by the Z3. I raised this issue because how @zgorizzo69 asking me to developed for other platforms #702 (comment) that are probably out of reach within a scope of a PR validates my point. other os

Docker improves this by relying on one platform and one way of doing things. But this is just a suggestion issue, it can be tackle later or might never be

to answer the second. The script it's necessary, the Z3 building it's not about the solidity, the z3 just builds z3 they don't care how you use it. The script outlines a series of steps specifically to run Z3 within! the solidity compiler

#702 (comment)

I agree that supporting SMT script for different operating systems is out of scope for this issue

Regarding this one: I guess @zgorizzo69 's point was to create a script that checks for necessary packages (python3, g++, etc...) rather than supporting different OSs

Anyway, the PR is merged, so let's close this one for now and get back to it we have some complex stuff to setup

ubiquibot[bot] commented 1 year ago

Permit generation skipped because the issue was not closed as completed