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

Workspace refactor #66

Merged
merged 43 commits into from
Dec 29, 2024
Merged

Conversation

wangpatrick57
Copy link
Member

@wangpatrick57 wangpatrick57 commented Dec 26, 2024

Summary: Refactored the workspace for the new submodule architecture.

Demo:
Added 22 tests in a new file (unittest_workspace.py) that are passing.
Screenshot 2024-12-28 at 16 12 35

Details:

  • The refactor is done but is not integrated. The old functions are all there. New versions of save_file() and link_result() are in DBGymWorkspace but are not used anywhere outside of the unit tests.
  • I got rid of the [codebase] component in task_runs/ and symlinks/ and replaced it with the [agent] component. This makes it possible to know where files from other agents are stored, which is crucial in the new submodule architecture.
    • In the monolith architecture, we knew the codebase structure of agents so we could build the [codebase] accordingly. Now, we don't know this so we need to decouple communication from the codebase structure of the agent.
    • Note that only symlinks/ uses[agent]. task_runs/ doesn't use either [codebase] or [agent] anymore for further simplicity.
  • I got rid of the [org] component as well for simplicity. The user can add their own organization if they like.
  • I renamed DBGymConfig to DBGymWorkspace to better reflect its function. I changed its initializer to only take in the workspace path instead of the config path as well.
  • I moved all the filesystem unittest helpers to their own file since both unittest_workspace.py and unittest_clean.py use them. This is more than just an aesthetic change. If we didn't move them and instead had unittest_workspace.py import unittest_clean.py, we would run the tests in unittest_clean.py twice.

@wangpatrick57 wangpatrick57 changed the title draft pr for ci Workspace refactor Dec 29, 2024
@wangpatrick57 wangpatrick57 merged commit 8511688 into cmu-db:main Dec 29, 2024
1 check passed
@wangpatrick57 wangpatrick57 deleted the workspace-refactor branch December 29, 2024 00:19
wangpatrick57 added a commit that referenced this pull request Dec 30, 2024
**Summary**: The codebase is now fully refactored to use the new
`open_and_save()`, `save_file()`, and `link_result()` functions from
#66. The old functions have been
removed.

**Demo**:
Wrote two new integration test files that pass.
<img width="905" alt="Screenshot 2024-12-30 at 10 45 53"
src="https://github.com/user-attachments/assets/ca197fe1-1a5b-4255-9ec7-515c7687caf1"
/>
<img width="1076" alt="Screenshot 2024-12-30 at 10 50 10"
src="https://github.com/user-attachments/assets/a621b5eb-4619-4e27-a2a7-85c8a8ff501c"
/>


**Details**
* Refactored `dbms/` and `benchmark/` to use the new files. Wrote tests
for both too.
* Moved path functions from `workspace.py` to
`gymlib/symlinks_paths.py`.
* This is important because agents will need access to the
DBMS/benchmark paths.
* Renamed all occurrences of `dpath/fpath/fordpath` to `path`. Renamed
`dname/fname` to `dirname/filename`.
* Names could refer to conceptual names so we add `dir/file` to the
front to disambiguate.
* Paths are not ambiguous though so we just call them paths. Whether
they're a directory or file matters a little, but I think it's cleaner
to just call them paths since that's the general standard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant