Skip to content

Commit 8e1e6f8

Browse files
authored
Merge pull request #220 from aryanndwi123/phase1-blog
add: simulator version control phase 1 report blog (2024)
2 parents 57a6cac + 1723daf commit 8e1e6f8

File tree

12 files changed

+133
-0
lines changed

12 files changed

+133
-0
lines changed

content/author/aryann-dwivedi.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
+++
2+
title = "Aryann Dwivedi"
3+
image = "/images/authors/aryann_dwivedi.jpg"
4+
description = "Undergrad at VNIT Nagpur | Open source enthusiast"
5+
+++
6+
7+
Google Summer of Code 2024 @ CircuitVerse || [Visvesvaraya National Institue of Technology, Nagpur](https://vnit.ac.in/)
8+
9+
[![X](https://img.shields.io/badge/Twitter-000000?style=for-the-badge&logo=x&logoColor=white)](https://x.com/dwivedi_aryann)
10+
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/aryann-dwivedi-9a20b4227/)
11+
[![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/aryanndwi123)
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: "Simulator Version Control: Phase 1 (GSoC 2024)"
3+
date: 2024-07-11T16:43:15+05:30
4+
draft: false
5+
author: Aryann Dwivedi
6+
type: post
7+
---
8+
9+
10+
11+
![coverImage](/images/Aryann_Dwivedi_GSoC24/coverImage.jpg)
12+
13+
This report consolidates the progress made during the first phase of Google Summer of Code 2024 coding period for the Simulator Version Control project with [CircuitVerse](https://github.com/circuitverse).
14+
15+
### About my Project
16+
17+
[My Project](https://github.com/CircuitVerse/CircuitVerse/wiki/GSoC'24-Project-List#project-5---simulator-version-control) aims to implement a version control system for the CircuitVerse Vue simulator to maintain compatibility of circuits while allowing for independent simulator updates and version switching.
18+
19+
20+
21+
### Community Bonding Period @Circuitverse
22+
23+
We had our first meeting with all the mentors and contributors, and it was a pleasure to meet everyone. The meeting was very productive, allowing us to learn more about CircuitVerse's culture and its mission to provide free digital logic circuit simulators to over half a million people. These exchanges promoted understanding and laid the groundwork for effective teamwork through shared experiences and technological discussions.
24+
25+
### Milestones Achieved
26+
27+
Tasks Completed So Far:
28+
29+
- Versioning directories
30+
- Modifying the build script
31+
- Adding a version column to the projects schema.
32+
- Creating a bash script to build different versions for Vite
33+
- Implementing hot-swapping of the Vue simulator from the main CircuitVerse repository by taking query parameter (simver).
34+
35+
36+
#### Versioning Directory
37+
38+
The foundational task for the simulator versioning was to create separate directories for different versions of Vue simulator. I moved the src directory of the vue simulator to different versions (v0 and v1) and adjusted the required imports in the files.
39+
40+
**Vue Simulator Architecture**
41+
42+
![Work Flow](/images/Aryann_Dwivedi_GSoC24/vue_simulator_architecture.webp)
43+
44+
45+
46+
**Pull Requests**
47+
48+
- [Adding Versioned Directory (v0 and v1)](https://github.com/CircuitVerse/cv-frontend-vue/pull/319)
49+
50+
#### Modifying the Build script
51+
52+
With the directories restructured for different simulator versions, the build configurations needed to be changed to serve the correct version when required.
53+
54+
- A `version.json` file was created to store the description, date, and name of each version.
55+
56+
![Work Flow](/images/Aryann_Dwivedi_GSoC24/version_storage.webp)
57+
58+
- The build script in the Vue simulator was modified to build different versions based on the version variable, iterating through the version.json file.
59+
60+
- Separate files were created for the two versions and built using a bash script.
61+
62+
![Work Flow](/images/Aryann_Dwivedi_GSoC24/bash_script.png)
63+
64+
- The script was updated to save builds in separate directories for each version as `public/simulatorvue/v0` and `public/simulatorvue/v1` in the Main CircuitVerse repository.
65+
66+
67+
68+
**Pull Request**
69+
70+
- [Build Script Modification](https://github.com/CircuitVerse/cv-frontend-vue/pull/327)
71+
72+
#### Adding a version column to the projects schema.
73+
74+
To store the version of the circuit in the database, a new column named `version` was added.
75+
76+
![Work Flow](/images/Aryann_Dwivedi_GSoC24/adding_version_column.webp)
77+
78+
**Pull Request**
79+
80+
- [Adding version column to Projects table](https://github.com/CircuitVerse/CircuitVerse/pull/4999)
81+
82+
#### Hot-Swapping Implementation
83+
84+
To swap versions of the simulator, I used a query parameter (simver) in the URL to serve the appropriate version. If `simver=v0`, version v0 is served; if `simver=v1`, version v1 is served.
85+
86+
- The path of the entry point in index.html was changed from `src/main.ts` to `version/main.ts` to modify the serving file accordingly.
87+
88+
![Work Flow](/images/Aryann_Dwivedi_GSoC24/index_entrypoint.png)
89+
90+
- The logic to change the simulator version variable based on the version was added to another file and imported into version/main.ts.
91+
92+
![Work Flow](/images/Aryann_Dwivedi_GSoC24/version_loader.png)
93+
94+
95+
- The correct version was imported according to the specified `simver` variable.
96+
97+
98+
99+
![Work Flow](/images/Aryann_Dwivedi_GSoC24/version_config_simver.png)
100+
101+
**Pull Request**
102+
103+
- [Enable Main simulator to load Vue simulator](https://github.com/CircuitVerse/cv-frontend-vue/pull/332)
104+
105+
#### FINAL RESULT
106+
107+
In this video, the version is specified on the navbar soleley for representation purposes. It is not included in the actual project or code.
108+
109+
{{< video src="/images/Aryann_Dwivedi_GSoC24/version-hostswapping.webm" type="video/webm" preload="auto" >}}
110+
111+
112+
113+
### Learnings
114+
115+
- Gained an understanding of how the Vue simulator works, particularly the query parameters and imports.
116+
- Learned more about version control systems.
117+
- Acquired knowledge of best practices to follow while writing code.
118+
119+
### Conclusion
120+
121+
Phase 1 of GSoC 2024 at CircuitVerse focused on implementing a simulator version control system, enhancing technical skills in Vue.js and scripting, and reinforcing best coding practices.
122+
39.2 KB
Loading
32.5 KB
Loading
235 KB
Loading
15.9 KB
Loading
637 KB
Binary file not shown.
18.1 KB
Loading
28.1 KB
Loading
8 KB
Loading

0 commit comments

Comments
 (0)